#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_PATH 256
char filename[MAX_PATH + 5];
int main(int argc, char** argv)
{
//数字字符串转数字
const char* kk = "689";
int zhi = atoi(kk) + 8;
//数字字符串转double
double zhi2 = atof(kk) + 2;
printf("result : %f \n", zhi2);
//数字转字符串
int nn = 58;
char zu[20];
snprintf(zu,20, "%d", nn);
printf("%d-----%d-----%s", sizeof(zu),strlen(zu),zu);
getchar();
return 0;
}
结果:
FR:徐海涛(hunkxu)