k simple task that i cant figure out :P i have a string stream called 'CP' and all i wanna do is place it in a char[250] array so in other words i need a way of taking single characters from the string stream, any help would be great, thanx
Printable View
k simple task that i cant figure out :P i have a string stream called 'CP' and all i wanna do is place it in a char[250] array so in other words i need a way of taking single characters from the string stream, any help would be great, thanx
its ok ive sorted it, just used memcopy and copied the complete string stream to a constant character array
This should work. Using memcpy is rather dangerous because the stringstream is an actual class, and you don't necessarily know where it actually stores the string relative to the start of the class' memory.
Code:stringstream ss( "this is a test" );
char x[250];
ss>>x;