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);