2.反思
9月27
练习2
1.sizeof( ?)求字节\\例:printf("sdasdad",sizeof(?));
#include<stdio.h>
using namespace std;
int main()
{
printf ("The size of short is %d bytes.\n",sizeof(short));
printf ("The size of int is %d bytes.\n",sizeof(int));
printf ("The size of long is %d bytes.\n",sizeof(long));
printf ("The size of long long is %d bytes.\n",sizeof(long long));
return 0;
}
2.#控制前导显示\\例:printf("%#o",a);
3.%o:16进制 %X:8进制
4.输出整数:printf("%d",0xABCD); 问:为什么这里用0数字而不是o字母?
5.字符用cahr printf 用%c