char to int
2012-11-02 19:46
190 查看
#include <iostream> using namespace std; int main() { int a=1; char b = (char)(a+48); int c = (int)(b-48); if(b == '1') cout<<b<<endl; if(c == 1) cout<<c<<endl; getchar(); }
相关文章推荐
- IP Char to Int
- 整型转字符串(convert int to char)优化实践
- error: cast from ‘char*’ to ‘int’ loses precision
- error C2664: 'atof' : cannot convert parameter 1 from 'int' to 'const char *'
- LoadCursorA' : cannot convert parameter 2 from 'const int' to 'const char *
- keil(MDK)中出现error: #513: a value of type "int" cannot be assigned to an entity of type "char *",即函数返回值无法赋值给对应变量的错误
- int to char* and char* to int
- int to char
- error: cast from ‘char*’ to ‘int’ loses precision
- char* inttoalpha( int value, char *string, int radix ) // 接口仿照库函数, radix 是基数:2进制,8,10,16 。
- cannot convert from 'const int' to 'const char *'
- incompatible pointer types assigning to 'int *' from 'char'
- int to SAFE_CHAR
- 6410_io_drv.c: error: invalid operands to binary << (have 'char *' and 'int') 错误处理
- 类似Build Error: #513: a value of type "int" cannot be assigned to an entity of type "char *"
- atoi char and string to int
- 整型转字符串(convert int to char)优化实践——一个意外的BUG
- 【笔记】编译报错error: cannot convert ‘main(int, char**)::sockadrr*’ to ‘const sockaddr*’ for
- error: cast from ‘char*’ to ‘int’ loses precision
- [Algorithms, C] long2char: 自己用C写来玩玩的整形转化为字符串函数 (递归和迭代两种实现): void long2char(long from, char *to, int n);