c++数字转化为字符串、字符串转换为数字

char ch[20];

int i =1;

int j = 2;

char *p = "34567";

数字装换为字符串 sprintf(ch , "%d,%d",i,j);

字符串转化为数字:

sscanf(p,"%d",&i);

i的z值就等于34567;

原文地址:https://www.cnblogs.com/chenzuoyou/p/3421866.html