下载此文档

CS-APP--SolutionManual软件开发书籍.pdf


文档分类:IT计算机 | 页数:约89页 举报非法文档有奖
1/89
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/89 下载此文档
文档列表 文档介绍
ComputerSystems:AProgrammer’sPerspective Instructor’sSolutionManual 1 ’Hallaron December4,2003 1Copyright c2003,,’. 2 Chapter1 SolutionstoHomeworkProblems Thetextusestwodifferentkindsofexercises: ,withexplanatory . simpledrillstomulti-weeklabsandaredesignedforinstructorstogiveasassignmentsortouseas recitationexamples. Thisdocumentgivesthesolutionstothehomeworkproblems. :puterSystems :RepresentingandManipulatingInformation : Thisexerciseshouldbeastraightforwardvariationontheexistingcode. code/data/show- 1voidshow_short(shortintx) 2{ 3 show_bytes((byte_pointer)&x,sizeof(shortint)); 4} 56voidshow_long(longintx) 7{ 8 show_bytes((byte_pointer)&x,sizeof(long)); 9} 1 2 10 11voidshow_double(doublex) 12{ 13 show_bytes((byte_pointer)&x,sizeof(double)); 14} code/data/show- : valuesforthemostandleast-signi?. ?rstbyteandconvertittoan -endianmachineand1onalittle-- 1intis_little_endian(void) 2{ 3 /*MSB=0,LSB=1*/ 4 intx=1; 56 /*ReturnMSBwhenbig-endian,LSBwhenlittle-endian*/ 7 return(int)(*(char*)&x); 8} code/data/show- : ?0xFFisaway togenerateamaskthatselectsallbuttheleastsigni?cantbytethatworksforanywordsize. (x&0xFF)|(y&?0xFF) : Theseexercisesrequirethinkingaboutthelogicaloperatio

CS-APP--SolutionManual软件开发书籍 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数89
  • 收藏数0 收藏
  • 顶次数0
  • 上传人新起点
  • 文件大小0 KB
  • 时间2016-04-20