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 *'