
March 15th, 2003, 07:12 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
It is a bad idea only if the function alters the char buffer. This is because, the string object may keep the size of the string allocated in a different member of the class (depending on the implementation of course), and if the function alters the char buffer, interesting things might occur later on. If the function accepts a const char* instead of a char *, then at least you have some assurance that the function is not going to alter the contents. BTW string objects have a c_str() member function which returns the pointer to the char array of the object.
Last edited by Scorpions4ever : March 15th, 2003 at 07:15 PM.
|