字符与整数互换

#include
#include
整数转换为字符串:

#include
#include
#include
using namespace std;
int main()
{
    int num = 100;
    char str[25];
    sprintf(str,"%d",100);
    printf("%c %c %c",str[0],str[1],str[2]);
    return 0;
}

字符串

 

转载于:https://www.cnblogs.com/Leozi/p/10835685.html

你可能感兴趣的:(字符与整数互换)