C++求职笔试题汇总.doc
上传人:sy****28 上传时间:2024-09-13 格式:DOC 页数:6 大小:36KB 金币:14 举报 版权申诉
预览加载中,请您耐心等待几秒...

C++求职笔试题汇总.doc

C++求职笔试题汇总.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

14 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

华为笔试题1.请你分别画出OSI的七层网络结构图和TCP/IP的五层结构图。2.请你详细地解释一下IP协议的定义,在哪个层上面?主要有什么作用?TCP与UDP呢?3.请问交换机和路由器各自的实现原理是什么?分别在哪个层次上面实现的?4.请问C++的类和C里面的struct有什么区别?5.请讲一讲析构函数和虚函数的用法和作用。6.全局变量和局部变量有什么区别?是怎么实现的?操作系统和编译器是怎么知道的?7.8086是多少位的系统?在数据总线上是怎么实现的?转贴请注明:HYPERLINK"http://www.pghome.net"\t"_blank"www.pghome.net联想笔试题1.设计函数intatoi(char*s)。2.inti=(j=4,k=8,l=16,m=32);printf(“%d”,i);输出是多少?3.解释局部变量、全局变量和静态变量的含义。4.解释堆和栈的区别。5.论述含参数的宏与函数的优缺点普天C++笔试题1.实现双向链表删除一个节点P,在节点P后插入一个节点,写出这两个函数。2.写一个函数,将其中的\t都转换成4个空格。3.Windows程序的入口是哪里?写出Windows消息机制的流程。4.如何定义和实现一个类的成员函数为回调函数?5.C++里面是不是所有的动作都是main()引起的?如果不是,请举例。6.C++里面如何声明constvoidf(void)函数为C程序中的库函数?7.下列哪两个是等同的intb;Aconstint*a=&b;Bconst*inta=&b;Cconstint*consta=&b;Dintconst*consta=&b;8.内联函数在编译时是否做参数类型检查?voidg(base&b){b.play;}voidmain(){sons;g(s);return;}1.HowdoyoucodeaninfiniteloopinC?2.Volatile:(1)Whatdoesthekeywordvolatilemean?Giveanexample(2)Canaparameterbebothconstandvolatile?Giveanexample(3)Canapointerbevolatile?Giveanexample3.Whatarethevaluesofa,b,andcafterthefollowinginstructions:inta=5,b=7,c;c=a+++b;4.Whatdothefollowingdeclarationsmean?(1)constinta;(2)intconsta;(3)constint*a;(4)int*consta;(5)intconst*aconst;5.Whichofthefollowingstatementsdescribetheuseofthekeywordstatic?(1)Withinthebodyofafunction:Astaticvariablemaintainsitsvaluebetweenfunctionrevocations(2)Withinamodule:Astaticvariableisaccessiblebyallfunctionswithinthatmodule(3)Withinamodule:Astaticfunctioncanonlybecalledbyotherfunctionswithinthatmodule6.Embeddedsystemsalwaysrequiretheusertomanipulatebitsinregistersorvariables.Givenanintegervariablea,writetwocodefragments.Thefirstshouldsetbit5ofa.Thesecondshnuldclearbit5ofa.Inbothcases,theremainingbitsshouldbeunmodified.7.Whatdoesthefollowingfunctionreturn?charfoo(void){unsignedinta=6;ihtb=-20;charc;(a+b>6)?(c=1):(c=0);returnc;}8.WhatwillbetheoutputofthefollowingCcode?main(){intk,num=30;k=(num>5?(num<=10?100:200):500);printf(“%d”,k);}9.WhatwillthefollowingCcodedo?int*ptr;ptr=(int*)Ox67a9;*ptr=Oxaa55;10.WhatwillbetheoutputofthefollowCcode?#define