Nov 27, 2002 #2 Zyrenthian Programmer Mar 30, 2001 1,440 0 0 US char buffer[] = "1234"; int bufValue = atoi(buffer); // UNICODE int bufValue = _ttoi(buffer); if it is a float use atof or _tcstod respectively Matt Upvote 0 Downvote
char buffer[] = "1234"; int bufValue = atoi(buffer); // UNICODE int bufValue = _ttoi(buffer); if it is a float use atof or _tcstod respectively Matt
Nov 27, 2002 Thread starter #3 adi316 Programmer Sep 10, 2002 35 0 0 CA o sorry i guess is hould have mentioned im writting c++, and the <string> class. that code gives me an error: error C2664: 'atoi' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *' Upvote 0 Downvote
o sorry i guess is hould have mentioned im writting c++, and the <string> class. that code gives me an error: error C2664: 'atoi' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
Nov 27, 2002 #4 Zyrenthian Programmer Mar 30, 2001 1,440 0 0 US i belive there is a cstr function of the string class that will return a constant string from the object. Matt Upvote 0 Downvote
i belive there is a cstr function of the string class that will return a constant string from the object. Matt