#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>intmain(){int arr[]={1,2,3,4,5};short* p =(short*)arr;//short 两个字节int i =0;for(i =0; i <4; i++){*(p + i)=0;//四次初始化,,每次2个字节,4次8个字节--即前两个数字}for(i =0; i <5; i++){printf("%d ", arr[i]);// 0 0 3 4 5}printf("\n---------------------------------\n");int a =0x11223344;char* pc =(char*)&a;*pc =0;printf("%x\n", a);//11223300return0;}
00345---------------------------------11223300
#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>int i =0;//全局变量-不初始化-默认是0intmain(){
i--;if(i >sizeof(i)){//sizof()-计算变量/类型所占内存的大小 >=0 无符号数printf(">\n");}else{printf("<\n");}printf("------------------------\n");int a, b, c;
a =5;
c =++a;//a=6,c=6
b =++c, c++,++a, a++;//c=8,b=7,a=8
b += a+++ c;//b=23,a=9printf("a=%d b=%d c=%d\n", a, b, c);return0;}
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>int main() { int arr[] = { 1,2,3,4,5 }; short* p = (short*)arr;//short 两个字节 int i = 0; for (i = 0; i < 4; i++) { *(p + i) = 0;//四次初始化,,每次2个字节,4次8个字节--即前两个数字 } for (i = 0; i < 5; i++)