My compiler is DevC++ version 4.
I'm afraid I've deleted all my attempts at atoi because they didn't work! Although if I remember correctly, the error that I got when using Atoi was that it couldn't convert a string to a char* bizarrely.. I don't really know why this is.. I'll try and recreate the error for you. Do you have any simple atoi segments that I could try and use to make sure I'm not doing anything stupid?
But yes, include sstream doesn;t work.
Code:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ( ) {
string a = "10";
istringstream b(a);
int c;
b >> c;
cout << "Result=" << c << endl;
}
Something like that would be ideal for my needs!!
Thanks for your responses.
I've just recreated the atoi error, it is :
Code:
68 CdPlayer.h cannot convert `line' from type `string' to type `const char *'
the line of code for the conversion is
Code:
Leigh = atoi(line);
Is it because the atoi method requires to be passed a char * and not a string string?!