sizeof返回对象或类型名的长度,返回值类型为size_t,长度的单位是字节。 sizeof操作符在编译时已经得到了结果,即sizeof表达式的结果是编译时常量,字节对齐是编译时决定的。 字长:指明整数和指针数据的标称大小。 sizeof 计算栈中分配的大小,对于静态变量和全局变量都是存放在全局数 Read More
posted @ 2014-06-12 10:53
Xylophone
Views(609)
Comments(0)
Diggs(0)
注意:整形数据,正数或者负数都可以,但atoi和itoa不适用于带小数点的数。(1)string“11”转换成整数11string str;int i = atoi(str.c_str());或者用字符指针:char *pStr;int i = atoi(pStr);(2)整数转换成字符指针:ito... Read More
posted @ 2014-06-12 10:25
Xylophone
Views(395)
Comments(0)
Diggs(0)
常用以下ASCII:(1)十进制数0到9 (可以用此进行0到9之间的char和int的转换,记住超过9的数就不灵了:char a =0x31;cout<<a<<endl //输出1) 0 1 2 3 4........ 0x30 0x31 0x32 0x33 0x34...(2)字母... Read More
posted @ 2014-06-12 10:10
Xylophone
Views(206)
Comments(0)
Diggs(0)
Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?"Time Limit Exceeded"费时间的方法如下:查看p结点与它之前的结... Read More
posted @ 2014-06-12 09:20
Xylophone
Views(142)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号