资源描述:
《C_Cprogrammerquestionsanalysis(C_C程序员应聘试题剖析)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、C_Cprogrammerquestionsanalysis(C_C程序员应聘试题剖析)Thisarticleiscontributedbywen_yeahDOCdocumentsmayexperiencepoorbrowsingontheWAPside・ItisrecommendedthatyoufirstselectTXT,ordownloadthesourcefiletothelocalview.C/C++programmerquestionsanalysisIntroductionthepurposeofthispaperisnottoprovideC/C+
2、+programmerjobinterviewguide,andtofacequestionsfromcontentanalysistechnology.Inthispaper,mostoftheinterviewquestionsfromthevariousforums,somequestionsansweredalsomadereferencetotheviewsofusers・Manyinterviewquestionsseemsimple,butprofoundbasicskillsneededtogivetheperfectanswer・Theenterp
3、riseaskedtheinterviewertowriteasimplestrcpyfunctionoftheinterviewcanbeseeninthetechnologyofhowtoachievetheextentofwhat,wecanreallywriteastrcpyfunction?Weallthinkhecan,butwewritethestrcpyislikelytoreceiveonly10pointsin2minutes・Thereadercanseestrcpyfunctionfrom2to10decompositionexampleso
4、fanswersfromthisarticle,seethemselvesaswhatkindofleveLInaddition,therearesomewhofaceinterviewTestQuestionsquickthinkingabilityanalysis・Thesequestions,itselfcontainsastronginterest;andasaR&Dpersonnel,throughin-depthanalysisofthesequestionswillbefurtherstrengthentheirowninternalstrength・
5、1.forthe1:voidtestl(errortest){charstring[10];char*STR1=0123456789;strcpy(string,STR1);}2:testvoidtest2(char){string[10],strl[10];inti;for(i=0;i〈10;i++){strl[i]二'a';}strcpy(string,STR1);}3:voidtest3(char*testSTR1){charstring[10];if(strlen(STR1)<二10){strcpy(string,STR1);}}Answer:Test1st
6、ringSTR1requires11bytestostore(includingthe, '),andstringisonly10bytesofspace,strcpywillleadtotest2,arraybounds;iftheinterviewerpointedoutthatSTR1doesnotendinthecharacterarrayarraycangive3points;iftheinterviewernoted(string,strcpySTR1callfromSTR1memory)thenumberofbytescopiedtothestrin
7、gmemorycopyisuncertaincangive7points,onthisbasisthatthelibraryfunctionstrcpyworkto10;totest3,if(strlen(STR1)<二10)shouldbechangedtoif(strlen(STR1)<10),becausethe1bytesofthestrlenresultsarenotoccupiedbythe' '・Thestatisticalanalysis:examinethemasteryofbasicskills:(1)thestringendswith,