atoi
函數將字符串轉換為整型,例如:char str[] = "12345";
int num = atoi(str);
atol
函數將字符串轉換為長整型,例如:char str[] = "1234567890";
long num = atol(str);
atof
函數將字符串轉換為浮點型,例如:char str[] = "3.14";
float num = atof(str);
sprintf
函數將整型轉換為字符串,例如:int num = 12345;
char str[10];
sprintf(str, "%d", num);
sprintf
函數將長整型轉換為字符串,例如:long num = 1234567890;
char str[20];
sprintf(str, "%ld", num);
sprintf
函數將浮點型轉換為字符串,例如:float num = 3.14;
char str[10];
sprintf(str, "%f", num);