"berkay" <be**********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
i have a string s1 and if i want to make such a thing
strstreambuf bbuf(char*,int);
it only accepts a pointer and i have a string how can i do this i ll be
happy if u can help me
If the bbuf doesn't change the string, you can pass sl.c_str() but this is a
const pointer. So you would have to const_cast it const_cast<char*>(
sl.c_str() ) BUT, make 10000% sure that bbuf does NOT change the data.
Now, if it does it is possible to pass sl.data() which is not const, it can
be changed, but it is a fixed length buffer, make sure your bbuf doesnt' try
to write past the end of it.