示例#include<stdio.h>int inttoascii(int number) { return '0' + number;}main() { printf("the ascii of 5 is %d\n", inttoascii(5)); printf("the ascii of 8 is %d\n", inttoascii(8));}
输出the ascii of 5 is 53the ascii of 8 is 56
以上就是将一个整数转换为ascii字符在c/c++中的详细内容。
