资源描述:
《青岛理工大学C++考试真题.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.I.Judgment.(Therightansweris“T”,thewrongoneis“F”.Eachjudgmentis2points,total20points.)Number12345678910T/F1.Bothconstructoranddestructorofbaseclasscanbeinheritedbyderivedclass.2.Staticdatamemberissharedbyallobjectsofthisclass.3.Constructorscanbedeclaredas
2、virtualfunction.4.Whenoverloadinganoperator,atleastoneargumentoftheresultingoverloadedoperatormustbeofaclasstype.5.Constructorshavenoreturntype.6.Afriendfunctionisnotamemberoftheclass,butitcanaccesstheprivatemembersofthatclass.7.Wecanonlylisttypesofformalp
3、arametersinfunctiondeclarations.8.Thereareloopstatementscanbewroteintheinlinefunction.9.Theassignmentoperatorcanonlybeoverloadedintoamemberfunction.10.InC++,STLisastandardfunctiontemplatelibrary.II.Fillintheblank.(Eachblankis1point,total:10points)1.Thedefa
4、ultaccesslabelforclassis___________.2.Theconstructorandthedestructormusthavethesameastheclass,.3.Thememberfunctionsofderivedclassescangetaccessto___membersand__membersofabaseclass,donotgetaccesstoprivatemembersofabaseclass.4.InC++,aclasswithapurevirtualfun
5、ctioniscalledan_______.5.SupposewehaveaclassnamedasDc,whensuchcodelike“Dca[5],b(2),*p;”isimplemented,thesystemwillauto-calltheconstructorofclassDcfor_______times.6.Statement___________cancatchallkindsofexceptions.7.InC++,inadditionto“.”,“*”,“sizeof”,theope
6、rator________and_______arealsocan’tbeoverload.8.Classistreamisusedtosupportinputoperation,andclass_______isusedtosupportoutputoperation.III.SingleChoice(Eachchoiceis2point,total:10points)1.()Usuallycopyconstructor’sparameterisA)thenameofsomeobjectB)therefe
7、renceofsomeobjectC)membernameofsomeobjectD)thepointerofsomeobject2.()Whichiswrongaboutconstructor?A)Thecompilermaysupplydefaultconstructor.B)Constructorscanhaveparameters,andreturnedvalue.C)Constructorscanbeoverloaded.D)Constructorscanhavedefaultparameterv
8、alue.3.()Whichiswrongaboutfriend?A)Thekeywordfriendisusedtodeclarethefriend.B)Thememberfunctionofoneclasscanbethefriendofanotherclass...C)Thefriendfunctionscanaccessanyspecifiedaccesslabelmember.D)Thefriendfu