why won't atof work here?

Discussion in 'C Programming' started by perien, Jun 12, 2010.

  1. perien

    perien

    Joined:
    Jun 12, 2010
    Messages:
    1
    Likes Received:
    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 (Text):
    vector<string> enVec;
    Code (Text):
    cout << enVec[1];
    gives the following

    -4.07359333e+00

    so why doesn't something like this work?

    Code (Text):
    atof(enVec[1])
    I get the error:

     
    perien, Jun 12, 2010
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marina

    Re: WHY, WHY WON'T IT WORK???

    Marina, Jun 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    562
    Marina
    Jun 29, 2004
  2. Chad
    Replies:
    4
    Views:
    8,652
  3. Drew

    Why doesn't atof work?

    Drew, Jan 20, 2004, in forum: C++
    Replies:
    10
    Views:
    5,438
    Jeff Schwab
    Jan 23, 2004
  4. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    737
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  5. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,386
    Mark Rae
    Dec 21, 2006
  6. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,854
    Smokey Grindel
    Dec 2, 2006
  7. baumann@pan

    why function like macro doesn't work here?

    baumann@pan, Jul 8, 2005, in forum: C Programming
    Replies:
    8
    Views:
    589
    Sensei
    Jul 15, 2005
  8. LC
    Replies:
    9
    Views:
    835
    Mike Treseler
    Nov 12, 2009
Loading...