For Programmers: Free Programming Magazines  


Home > Archive > VC STL > April 2005 > vector of strings to int









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author vector of strings to int
sho

2005-04-14, 9:01 pm

i need to convert a vector of strings integers.

vector<string>equation;
int x;
i have tried atoi but i get errors.
x=atoi(equation[0]);
like that but i can't do that what do i have to do.
Igor Tandetnik

2005-04-14, 9:01 pm

"sho" <sho@discussions.microsoft.com> wrote in message
news:19A2E074-BD67-4827-8242-04023A11D020@microsoft.com
> i need to convert a vector of strings integers.
>
> vector<string>equation;
> int x;
> i have tried atoi but i get errors.
> x=atoi(equation[0]);
> like that but i can't do that what do i have to do.


x=atoi(equation[0].c_str());
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com