数据结构12.8

  1. data=data | (0x01<<6);

data=data&(~(0x01<<6));

data=data^(0x01<<6);

  1. (1)5

(2)a=8,b=10,c=5,d=13

  1. (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

  1. 9
  2. (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. (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. (1)Rdy[i/8]=Rdy[i/8] | (1<<i%8)

(2) Rdy[j/8]=Rdy[j/8] & (~(1<<i%8))             

(3)

  1. i的范围没有判断,若传入的i不在0到100之间就超出了data数组的范围,应在fun函数最前面加上if(i<0||i>100) {return;}

fun函数中没有判断传入的value中的值是否为空,若为空,则*valu会访问空指针出现段错误

应在fun函数最前面加上if(NULL==value){return;}

  1. m为char型,但fun函数传参需要int型,会报错;

int m=15;

主函数最后应该加上return 0;

  1. (1)getmemory函数并不能改变外部函数的值,对P的操作没有影响到str;所以line5的str依然指向空

(2)line1->void GetMemory(char **p);

Line2->*p=(char*)malloc(10);

line4->GetMemory(&str);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值