SyntaxFix
Write A Post
Hire A Developer
Questions
Use the ASCII to Integer atoi() function which accepts a string and converts it into an integer:
atoi()
#include <stdlib.h> int num = atoi("23"); // 23
If the string contains a decimal, the number will be truncated:
int num = atoi("23.21"); // 23