why won't atof work here?

Joined
Jun 12, 2010
Messages
1
Reaction score
0
I'm fairly new (my second day) to c++ so if this is a dumb question, I apologize in advance:


I have a vector enVec defined as follows

Code:
vector<string> enVec;

Code:
cout << enVec[1];
gives the following

-4.07359333e+00

so why doesn't something like this work?

Code:
atof(enVec[1])

I get the error:

error: no instance of function "atof" matches the argument list
argument types are: (std::string)
atof(enVec[1]);
^
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top