Jan 17, 2012 at 4:07pm UTC
cout<<"\n "<<subexpresionesparentesis[3]<<subexpresionesparentesis[1]<<subexpresionesparentesis[2];
exponenterestado=atoi(subexpresionesparentesis[3]);
cout<<exponenterestado<<"dx"<<subexpresionesparentesis[1];
I get:
C:\Users\Daniel\Documents\Universidad\ProyectosCpp\derivadas\main.cpp|85|error: cannot convert 'std::string' to 'const char*' for argument '1' to 'int atoi(const char*)'|
Jan 17, 2012 at 4:10pm UTC
seeing line 85 would be helpful
Jan 17, 2012 at 4:12pm UTC
i would be careful about posting all of the error line because now I know your name is Daniel and you are (more than likely) spanish and you either are in or work at a university
Jan 17, 2012 at 4:14pm UTC
line 85 is the exponenterestado=atoi(subexpresionesparentesis[3]);
and there are so many Daniels that are spanish and go to university that I am not worried at all xD!
Jan 17, 2012 at 4:15pm UTC
You need to use the c_str()
on your string inorder to get a pointer to the actual c-string data.
Jan 17, 2012 at 4:17pm UTC
where do i use that c_Str, and also do I need a special library? I tried to use it and said that c_Str() was not declared...
Jan 17, 2012 at 6:20pm UTC
Probably:
exponenterestado=atoi(subexpresionesparentesis[3].c_str());
Jan 17, 2012 at 6:30pm UTC
Galik I love you ^^ thanks.
Jan 19, 2012 at 3:54pm UTC
no, I know that its common, and that in reality revealed only where the file is stored, but just be careful about how much you put out there