1.
data || 1(<<7)
data && ~(1<<7)
data ^ (1<<7)
2.
(1)5
(2)6,5,5
d=5,循环执行5此,就是5个char类型,strlen=5
3.
tmpInfo1.height=1;
tmpInfo1.baseInfo.with=2
tmpInfo2.height=1
tmpInfo2->baseInfo.with=2
tmpInfo3->height=1
4.9
5.
(1)int *p=(int *)0x80000000;
*p=tmp;
tmp=*p;
(2)char *q=(char*)&tmp;
for(i=0;i<4;i++)
buf[4+i]=q[i];
(3)
char*buf[count]===>char *buf=(char*)malloc(count*sizeof(char))
6.
(1)seqn[tail]=data;
tail++;
(2)data=seqn[head];
head++;
(3)if(head==tail)
(4)if((tail-head)==SEQLEN)
(5)head=tail;
tail++;
(6)tail-head;
(7)SEQLEN
7.
(1)Rdy[i] || (1<<i)
(2)Rdy[j] && ~(1<<j)
(3)
8.可能出现i>=100等情况,数组不包含该下标。并且*value=0没有意义。
加一个0<=i<100,把*value=0移到赋值语句前面
9.int型变量作为参数,调用了参数为int型变量的函数,会导致数据出错。
10.(1)str指针指向NULL,给空指针申请了10字节的内存空间,之后又进行了12字节空间的赋值。
(2)
第三行:p=(char*)malloc(32);
void Test(void)
{
char a[32]="hello world";
char *str;
GetMemory(str);
strcpy(str,a);
printf(str);
free(str);
str=NULL;
}