Like string can be converted to integer using atoi() function is it possible to convert strings into long . If so how to do this? Is there a predefined function available for doing this?
Printable View
Like string can be converted to integer using atoi() function is it possible to convert strings into long . If so how to do this? Is there a predefined function available for doing this?
It is very well possible to convert string into long using predefined function available in C namely atol(). But I am not aware of the header file in which this function is present. Can someone say me about this.
These functions namely atoi(), atol() are present header files namely stdlib.h. So one has to add the statement namely
#include <stdlib.h> while using these functions.
Hope this clarifies your query