- data=data | (0x01<<6);
data=data&(~(0x01<<6));
data=data^(0x01<<6);
- (1)5
(2)a=8,b=10,c=5,d=13
- (1)tmpInfo1.height=1
(2) tmpInfo1.baseInfo.with=2
(3) tmpInfo2.height=1
(4) tmpInfo2.baseInfo->with=2
(5) tmpInfo3->height=1
(6) tmpInfo3->baseInfo->with=2
- 9
- (1)int tmp ; int* ptr = (int*)0x80000000; *ptr = tmp;
(2)int tmp; int* ptr = (int*)0x80000000; tmp=*ptr;
(3)char **buf = (char**)malloc(count * sizeof(char*));
- (1)seqn[tail]=data;tail=(tail+1)%32;
(2)data=seqn[head];head=(head+1)%32;
(3)head=tail ? 1 : 0 ;
(4)head=(tail+1)%32 ? 1: 0 ;
(5)head=head-1;tail=head;
(6)(32+tail-head)%32;
(7)31
- (1)Rdy[i/8]=Rdy[i/8] | (1<<i%8)
(2) Rdy[j/8]=Rdy[j/8] & (~(1<<i%8))
(3)
- i的范围没有判断,若传入的i不在0到100之间就超出了data数组的范围,应在fun函数最前面加上if(i<0||i>100) {return;}
fun函数中没有判断传入的value中的值是否为空,若为空,则*valu会访问空指针出现段错误
应在fun函数最前面加上if(NULL==value){return;}
- m为char型,但fun函数传参需要int型,会报错;
int m=15;
主函数最后应该加上return 0;
- (1)getmemory函数并不能改变外部函数的值,对P的操作没有影响到str;所以line5的str依然指向空
(2)line1->void GetMemory(char **p);
Line2->*p=(char*)malloc(10);
line4->GetMemory(&str);