-
What string function is used to convert a string into long value?
This is done by using the function named as atol() . This function atol() is present in the header file named as <stdlib.h>. So when programmers use this function they must include the header file by the statement #include <stdlib.h> The syntax for this function is given by long atol( const char *s) Here the function atol() converts the string pointed by s into long and the...
-
How to convert a character string to a time value?
There is a function available in C for converting a character string to a time value. The function is strptime(). This function is not present in string.h but the prototypes of this function is present in time.h and so one has to include <time.h> when using this function strptime(). The syntax of theis functions is given below: char * strptime(const char *s,const char *f, struct tm *t); The...
-