help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Size limit of "std::ostringstream buffer"


From: Aakash Dalwani
Subject: Size limit of "std::ostringstream buffer"
Date: Sun, 07 May 2006 15:17:24 -0400
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

A quick question,
What is the maximum size that will be allocated to a buffer declared as:
std::ostringstream buffer

in a dynamically loaded library?

Please see the sample code below

A prompt reply will be highly appreciated.
Thanks,
Aakash


test.cc

#include <iostream>
#include <sstream>
#include <fstream.h>
#include <mpi.h>

#include <octave/oct.h>
#include <octave/ls-oct-binary.h>
#include <octave/ls-oct-ascii.h>
#include <octave/pager.h>

DEFUN_DLD (test, args, "test (a,b,c)\n\
\n\
Test function")
{
 octave_value retval;

 int nargin = args.length ();

std::ostringstream buffer;

     for (int i = 3; i < nargin; i++)
       save_binary_data (buffer, args (i), "", "", false, false);

     std::string s = buffer.str ();
     size_t len = s.length ();

     const char *data = s.data ();
retval=s.data

 return retval;
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]