Function name: atol atoi

xiaoxiao2021-03-06  14

Function Name: ATOI function: Conversion of strings to growth integer: int Atoi (const char * nptr); program case: #include

#include

INT main (void) {Int n; char * str = "12345.67";

n = ATOI (STR); Printf ("String =% S INTEGER =% D / N", STR, N); RETURN 0;}

Function Name: ATOL function: Conversion of string to growth integer: long atol (const char * nptr);

#include

#include

INT main (void) {long L; char * str = "98765432";

L = atol (LSTR); Printf ("String =% S INTEGER =% LD / N", STR, L); RETURN (0);}

转载请注明原文地址:https://www.9cbs.com/read-48108.html

New Post(0)