G
grahamo
Hi,
Can anybody tell me why I sometimes see an integer value when I try to
print the "out" variable below and if I coerce it into a (char*), I
see the string "hello" as expected. The str() member function returns
a char* so I would have thout there was no coercing needed. ???
char* in = strdup("hello");
strstream input(in, strlen(in);
input << std::ends;
cout << "stream contains " << input.str() << endl;
char* out = strdup(output.str());
cout << "out is " << out << endl;
cout << "out is " << (char*) out << endl;
thanks a million
GrahamO
Can anybody tell me why I sometimes see an integer value when I try to
print the "out" variable below and if I coerce it into a (char*), I
see the string "hello" as expected. The str() member function returns
a char* so I would have thout there was no coercing needed. ???
char* in = strdup("hello");
strstream input(in, strlen(in);
input << std::ends;
cout << "stream contains " << input.str() << endl;
char* out = strdup(output.str());
cout << "out is " << out << endl;
cout << "out is " << (char*) out << endl;
thanks a million
GrahamO