Subj : Re: mixing c/c++ (revised) To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Thu Jul 17 2003 06:06 pm Rob wrote: >In this program, C++ passes to C which initializes the char >array [C++ does it way different than C!], No, actually, they do it the same. Your problem is that you are mixing strings and char arrays. They are not the same thing. If you replace the string variable with a char array (large enough, of course) your problems will go away. Or, if you still want to use string, then you must pass the char array portion (.cstr) to functions that expect char*. Note that your .cat. will add onto the end of a char array that might be too small for it. Why? Because string dynamicaly allocates string space and might/probably not have allocated enough for you to add to it (especially without it's knowledge). So, don't pass .cstr to a function that is going to change it's size. If you are going to mess with the size, pass the string. See, this is a big tipoff: extern "C" int AddToEnd( string *AddString ); int AddToEnd( char *AddString ) The fact that you had to use different variable types means you are doing something wrong. >(I have a second question, too. I can set a breakpoint in my >program, and then step throuth the program, but how do I watch >the values of particular variables????) Right click on the variable name (anywhere in the source) and choose Watch. .