Sometimes it does, but some other times it doesn't...See this picture:
I had a pop-up requesting for a path. This path string I converted into a char* and then I write this char to a file. Then I was taking only the filename using a function from another library and then I was setting this string st text to a Button in my app
I noticed that sometimes the button had filenames like hello.mp3- or hello.mp30 or hello.mp3` or hello.mp3P, hello.mp3P or other letters
I performed a check to see where the string is wrongly parsed and the result was when ofstream was writing it to the file. See this screenshot and tell me your opinion: http://a.imageshack.us/img228/3396/screenshot5f.png
Suggestion: Use std::strings instead of (const) char pointers/arrays to hold your strings.
Sometimes we have to deal with legacy C API we got no choice. We maybe writing a new C++ program but we are required to interface with legacy C API that usually accept only char * in the function arguments for string datatype. We can use C++ string c_str() method I know but old habits die hard for me :P
Although I hope for those legacy C API to be obsoleted, the real world is there are still lotsa of legacy code depending on those C API. I guess char * is hard to eliminate in another 10 years I guess :P