I am trying to find out if there is an alternative way of converting string to integer in C.

I regularly pattern the following in my code.

char s[] = "45";

int num = atoi(s);

So, is there a better way or another way?

14 Answers
14

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *