可用如sizeof(char),sizeof(char*)等得出32位编译器char :1个字节char*(即指针变量): 4个字节(32位的寻址空间是2^32, 即32个bit,也就是4个字节。同理64位编译器)short int : 2个字节int: 4个字节unsigned int : 4个字...
分类:
移动开发 时间:
2015-09-06 12:41:49
阅读次数:
143
1.类型转换 bool b = 42; // _b is true_int i = b; // _i has value 1_i = 3.14; // _i has value 3_double pi = i; // _pi has value 3.0_unsigned char c = -1; /...
分类:
编程语言 时间:
2015-09-06 09:41:34
阅读次数:
214
OS:Win7 ,Tools:VS2015DateTime.h#pragma oncestruct DateTime{public: unsigned Year; // years since 1900 unsigned short Month; // months s...
分类:
编程语言 时间:
2015-09-05 17:49:53
阅读次数:
329
http://www.cnblogs.com/stonehat/archive/2011/10/14/2212141.htmlhttp://m.blog.csdn.net/blog/u010086298/37777607先看两个例子#include int main(int argc, char *...
分类:
其他好文 时间:
2015-09-05 14:57:52
阅读次数:
170
Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl...
分类:
其他好文 时间:
2015-09-05 00:04:02
阅读次数:
154
1.类型转换 bool b = 42; // _b is true_int i = b; // _i has value 1_i = 3.14; // _i has value 3_double pi = i; // _pi has value 3.0_unsigned char c = -1; /...
分类:
编程语言 时间:
2015-09-04 18:33:27
阅读次数:
179
1 #include 2 3 int flag = 0; 4 unsigned int Send_Data,Recv_Data; 5 6 void main() 7 { 8 SCON = 0X50; //MODE 2 9 TMOD = 0x20; //MODE 210 11...
分类:
其他好文 时间:
2015-09-04 15:32:47
阅读次数:
129
1、数组 sizeof用于整个数组名时将得到整个数组的字节数。初始化:double earnings[4] {}; //所有的元素都为零 unsigned int counts[10]={}; int a[]={1,3,4};2、字符串字符串是以空字符结尾的,空字符被些为\0。字符串...
分类:
其他好文 时间:
2015-09-03 20:22:07
阅读次数:
145
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming
weight).
For example, the 32-bit integer ’11' has binary representation 000000...
分类:
其他好文 时间:
2015-09-02 18:58:52
阅读次数:
133
Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For examp...
分类:
其他好文 时间:
2015-09-02 10:34:15
阅读次数:
124