




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
charstr1[]="abc";charstr2[]="abc";constcharstr3[]="abc";constcharstr4[]="abc";constchar*str5="abc";constchar*str6="abc";coutboolalphastr1==str2endl;coutboolalphastr3==str4endl;coutboolalphastr5==str6endl;C+AB,在哪幾種情況下BA?[C++中等試題]classBpublicABAclassBoperatorABAclassAAconstB&Anon-explicitB(可以有其他帶默認(rèn)值A(chǔ)&operatorconstA&voidUpperCase(charstrstr{for(size_ti=0;i<sizeof(str)/sizeof(str[0]);++i)if('a'<=str[i]&&str[i]<='z')str[i]-=('a'-'A'}charstr[]=cout"strsizeof(str)/sizeof(str[0])endl;UpperCase(str);cout<<str<<voidchar2Hex(charc16{charch=c/0x10+'0';if(ch>'9')ch+=('A'-'9'-charcl=c%0x10+'0';if(cl>'9')cl+=('A'-'9'-1);cout<<ch<<cl<<'';}charstr[]"Ilovefor(size_ti=0;i<strlen(str);++i)char2Hex(str[i]);cout<<structTest{Test(int)Test()voidfun()voidmain(void{TestTest}cout<<(true?1:"1")<<endl;unsignedintconstsize1=2;charstr1[size1];unsignedinttemp=0;cin>>temp;unsignedintconstsize2=temp;charstr2[size2];structCLS{intCLS(inti):m_i(i){}}CLScout<<obj.m_i<<class{EmptyEmpty(constEmpty&~EmptyEmpty&operator=(constEmpty&Empty*operator&();//取址運(yùn)算符constEmpty*operator&()constfloata=1.0f;cout<<(int)a<<endl;cout<<(int&)a<<coutboolalphaint)a(int&)aendl;floatb=0.0f;cout<<(int)b<<endl;cout<<(int&)b<<coutboolalpha(int)b(int&)bendl;vectorarray;array.push_back(1array.push_back(2array.push_back(3for(vector::size_typei=array.size()-1;i>=0;iarray{cout<<array[i]<<}typedefvectorIntArray;IntArrayarray;array.push_back(1);array.push_back(2array.push_back(2array.push_back(3arrayfor( toritor=array.begin();itor!=array.end();++itor{if(2==*itor)array.erase(itor}void*mymemcpy(void*dest,constvoid*src,size_tcount{char*pdest=static_cast<char*>(destconstchar*psrc=static_cast<constchar*>(srcif(pdest>psrc&&pdest<psrc+cout{for(size_ti=count-1;i!=-1;--i)pdest[i]=psrc[i];}{for(size_ti=0;i<count;++i)pdest[i]=psrc[i];}return}intmain(void{charstr[]=" mymemcpy(str+1,str+0,9);cout<<str<<endl;system("Pause");return0;}C++/CC++/CC++/CBOOLfloat,if(100,0.0FALSEintn較的if語句為:ifn0ifn0BOOLflagiffloatxifchar*pif二、以下為WindowsNT下的32位C++程序,請(qǐng)計(jì)算sizeof的值(10分)charstr[]=“ o”;char*p=str;intn=10;sizeof(str)=sizeof(p)=sizeof(n)=voidFunc(char{sizeof(str)}void*p=malloc(100sizeof(p)1ifndef/define/endif2、#include#includefilename.h”3、const(請(qǐng)至少說明兩種4、在C++程序中調(diào)用被C編譯器編譯后的函數(shù),為什么要加extern for(i=0;{if(condition)}if{for(i=0;i++;)}{for(i=0;i++;)}voidGetMemory(char*p){p=(char}void{char*str=NULL;GetMemory(str);strcpy(str," oworld");}charcharp[]=" oworld";returnp;}void{char*str=NULL;str=GetMemory();}VoidGetMemory2(char**p,int{*p=(char}void{char*str=NULL;GetMemory(&str,100);strcpy(str," o");}void{char*str=(char*)strcpy(str, (str);if(str!=NULL){strcpy(str,}}strcpychar*strcpy(char*strDest,constcharC++/C 到strDest,為什么還要char*類型的返回值Stringclass{String(constchar*strNULLString(constString&other);~String(void)String&operate(constString&other);char*m_data附錄CC++/CBOOLfloat,if(10BOOLflagif(3if(flag)ifflagif(flag==TRUE)if(flag==1)if(flag==FALSE)if(flag==0)floatxif(4constfloatEPSINON=if((x>=-EPSINON)&&(x<=if(x==0.0)if(x!=char*pif(3if(p==NULL)if(p!=if(p==0)if(p!=if(p)if二、以下為WindowsNT下的32位C++程序,請(qǐng)計(jì)算sizeof的值(10分)charstr[]=“ o”;char*p=str;intn=10;sizeof(str6(2)sizeof(p)=4(2)sizeof(n)=4(2)voidFunc(charstr[100]){sizeofstr4(2}void*p=malloc(100sizeofp4(21、頭文件中的ifndef/define/endif干什么用?(5分) 2、#include#includefilename.h”(5 C\C++面試Q1OSITCP/IPQ2IPTCPUDPQ3Q4C+CstructQ5Q6Q7Q8:8086:一般建議參加的研發(fā)面試的同學(xué)先要準(zhǔn)備一下相關(guān)的知識(shí),軟件的主:是看看C兩道c試題1、一個(gè)學(xué)生的信息是:,學(xué)號(hào),,等信息,用一個(gè)鏈表,把這些學(xué)生信息連在一起,給出一個(gè)age,在些鏈表中刪除學(xué)生等于age的學(xué)生信息。程序代碼#include#includestructstu{charname[20]; intno;intstructstu*structstu*creatlist(int{intstructstuh=(structstu*)malloc(sizeof(structstu));h->next=NULL;{s=(structstu*)malloc(sizeof(structstu));p->next=s;printf("Pleaseinputtheinformationofthestudent:name noage\n");scanf("%s%c%d%d",s->name,&s-> s->next=p=}printf("Createsuccessful!");}voiddeleist(structstu*s,int{structstu*p;{p=s=s-printf("Therecordisnotexist.");{p->next=s->next;printf("Deletesuccessful!");}}voiddisy(structstu{s=s->next;{printf("%s%c%d%d\n",s->name,s-> s=s->next;}}int{structstu*s;intn,age;printf("Pleaseinputthelengthofseqlist:\n");s=creatlist(n);printf("Pleaseinputtheage:\n");return0;}程序代碼#include#includevoiduppers(char*s,char{{*us=*s-32;*us=}*us=}int{char*s,*us;charprintf("Pleaseinputastring:\n");s=ss;printf("Theresultis:\n%s\n",us);}客戶端如何.Net組件實(shí)現(xiàn)WebService?WindowsDNA軟件外企C++面試題C\C++面試題Whatisachievedbyprefixingthe'static'keywordtoafile-levelfunctionorfile-levelvariabledeclaration?Describethedifferencebetweenthe“ISA”and“HASA”objectWhichisthestrongerrelationshipandJava&C#supportinterfacesdirectlywiththe“interface”keyword.C++doesnothavean“interface”keyword.HowdoyoucreateaninterfaceinWhere/whenistheuseofinterfacesespeciallyIfaprogramrequiresalargenumberofexecutioncontextswhatcanbedonetominimisethreadschedulingoverhead?Whatdoesitmeantosaythatafunctionisreentrant?Whataresomeofthewaysofachievingre-entrancy?c語言面試題2道()C++面試題更1、一個(gè)學(xué)生的信息是:,學(xué)號(hào),,等信息,用一個(gè)鏈表,把這些學(xué)生信息連在一起,給出一個(gè)age,在些鏈表中刪除學(xué)生等于age的學(xué)生信息。#include"stdio.h"#include"conio.h"structstu{charname[20]; intno;intstructstu*structstu*creatlist(int{intstructstuh=(structstu*)malloc(sizeof(structh->next=NULL;for(i=0;inext=printf("Pleaseinputtheinformationofthestudent:name noage\n");scanf("%s%c%d%d",s->name,&s-> s->next=NULL;p=s;}printf("Createsuccessful!");}voiddeleist(structstu*s,int{structstu*p;{p=s=s-printf("Therecordisnotexist.");{p->next=s->next;printf("Deletesuccessful!");}}voiddisy(structstu{s=s->next;{prin
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 農(nóng)資公司前臺(tái)管理制度
- 小微金融公司管理制度
- 醫(yī)院新型門診管理制度
- 券商外包日常管理制度
- 學(xué)校項(xiàng)目落地管理制度
- 黨員練功基地管理制度
- 國(guó)企合同審核管理制度
- 寢室衛(wèi)生消毒管理制度
- 華為銷售流程管理制度
- 小組婦女組長(zhǎng)管理制度
- 氣體安全知識(shí)培訓(xùn)(72張)課件
- 國(guó)際慕課學(xué)習(xí)者使用手冊(cè)
- 電子商務(wù)安全與支付09課件
- 共線向量與共面向量全面版課件
- JJG(晉) 22-2021 車用甲醇燃料加注機(jī)檢定規(guī)程
- 湘美版小學(xué)四年級(jí)美術(shù)下冊(cè)知識(shí)點(diǎn)
- 大連市住宅小區(qū)物業(yè)收費(fèi)等級(jí)標(biāo)準(zhǔn)
- 包裝自動(dòng)線課程設(shè)計(jì)含全套資料
- 長(zhǎng)輸管道施工
- 航模發(fā)動(dòng)機(jī)圖紙
- 農(nóng)村集體“三資”監(jiān)管工作培訓(xùn)考核試題
評(píng)論
0/150
提交評(píng)論