将int转换为char并将char转换为int [英] convert int to char and convert char to int

查看:169
本文介绍了将int转换为char并将char转换为int的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的朋友们.
请给我一个关于将int转换为char并将win32项目中的char转换为int的解决方案
谢谢.

Hi my friends .
pleas give me a solution about converting int to char and convert char to int in win32 project
Thank you .

推荐答案

使用itoaatoi:
http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/ [ ^ ]

http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/ [ ^ ]
Use itoa and atoi :
http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/[^]

http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/[^]


举个例子.
char ch =``0'';
int n = ch-48;
n的值大于0.
48是ASCII表中的距离.
Give a example.
char ch = ''0'';
int n = ch - 48;
Than value of n is 0.
48 is the distance in ASCII table.


这篇关于将int转换为char并将char转换为int的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆