Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
let suppose I have

string str[3];
str[0]=2;
str[1]=3;
str[2]=4;

Can I convert it into integer
Eg:
int i=234;

Please help
Posted
Comments
Philippe Mori 27-Aug-11 20:08pm    
You have declared an array of 3 strings...
Sergey Alexandrovich Kryukov 27-Aug-11 21:50pm    
First send a code sample which compiles, than ask a question.
--SA
Dr.Walt Fair, PE 27-Aug-11 22:37pm    
Since str is an array of strings, do you mean "2, "3", and "4"?
Philippe Mori 5-Sep-11 9:23am    
You already ask similar question.

C++
int i = atoi(str.c_str());
 
Share this answer
 
I think this was answered in one of your previous questions.
C++
atoi(str.c_str())
 
Share this answer
 
Comments
Trick7 27-Aug-11 18:50pm    
Hmmm thanks man.... Actually I am stuck in some problem that y got crazy.....
Albert Holguin 29-Aug-11 14:33pm    
not sure why this was voted down... or why there's two solutions with the same exact response...
Simon Bang Terkildsen 29-Aug-11 15:09pm    
I think we posted at the same time, or maybe I just stole Andrés answer ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900