With a char buffer from file, must I work with it with c (not c++)?

Feb 23, 2011 at 2:31pm
I want to do something with the buffer related to extract 'string' data.
If I dont want to duplicate memory resources, Must I to work with it using c?
(not c++) trought cstring funtions ?
Is another way?
Thanks
Feb 23, 2011 at 3:11pm
Um, I'm a bit confused on your request, but are you looking for something that would convert a "string" datatype to a "char *" datatype? You can try the"c_str()" method in a string.

Ex:
1
2
string str = "Hello World!";
char *cStr = (char *)str.c_str();    // We have to do some type-casting here 


Is this what you want?
Topic archived. No new replies allowed.