High,
I have a lot of trouble to choose a string class to produce Platform indepedant C/C++ code.
I thought with stl string class it will be right, but I still have many problems. The more important uestion IS : HOW to user stl string class with the standard sprintf and scanf ? I try to cast in (char*), to use string::c_str() to get a pointer, ... at the compilation everything is OK, but it crashed at the first sprintf or sscanf in the soft. :eveil: (All the string was set to a 128 length string before to be used).
Someone could help me to avoid this problem ? ;-)
Hi,
don't use sscanf and sprintf : use operator<< and operator>> instead. (use google to find a tutorial if needed).
Example :
string s;
cout << "enter your string : ";
cin >> s;
cout << " s is : " << s << endl;
__________________________
Lisp : (have a (nice day))
C : have (a, nice, day);
C++/Java : have.aNice(day);
OCaml : have a nice day;;
shell : have a nice $day