0

How to convert a Number string to integer Point in C??

A string suppose "1234". That is convert a integer number 1234. How to do this by C programming??

20th May 2023, 5:42 AM
Md. Tanvir Ahmed
Md. Tanvir Ahmed - avatar
2 Answers
+ 2
You can also use atoi() to convert c string to integer type of stoi() doesn't work.
21st May 2023, 10:10 AM
Purple Requiem
Purple Requiem - avatar
+ 1
char number[4] = “1234”; //String “1234” int num = stoi(number); // stoi() function to convert string to integer int *numptr = # // pointer to the integer
20th May 2023, 6:39 AM
Ugulberto SĂĄnchez
Ugulberto SĂĄnchez - avatar