Check out example codes for "what is atoi in strinf". It will help you in understanding the concepts better.

Code Example 1

The C library function int atoi(const char *str) converts the 
string argument str to an integer (type int).

Note: It is used in case of string because in strings a number is
also stored as char  and we have to do Typecasting  form (string -> int)

Learn ReactJs, React Native from akashmittal.com