ImageVerifierCode 换一换
格式:DOCX , 页数:14 ,大小:22.47KB ,
资源ID:6444143      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6444143.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(面试题目.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

面试题目.docx

1、面试题目笔试面试题整理,慢慢搜集现在的公司招聘,都要笔试面试.如果你不是那种编程功底非常深厚的人,又不好好准备一番,在笔试面试中往往会处于被动局面.虽然有些笔试题是故意为难我们,有点钻牛角尖.但是很多笔试题面试题确实能够很好地看出我们的基础. 在这里,我就略去那些钻牛角尖的题.从csdn论坛我近半年的收集中选出10道有代表性的题目,难度基本上是逐渐加大.对数组,指针,数据结构,算法,字符串,文件操作等问题都有覆盖.主要以c语言的实现为主,也有c+的题.大家可以先做做这10道题,测试一下自己的水平.1. 下面这段代码的输出是多少(在32位机上). char *p; char *q20; char

2、 *m2020; int (*n)10; struct MyStruct char dda; double dda1; int type ;; MyStruct k;printf(%d %d %d %d,sizeof(p),sizeof(q),sizeof(m),sizeof(n),sizeof(k);2.(1)char a223=1,6,3,5,4,15,3,5,33,23,12,7 ;for(int i=0;i6)?puts(6):puts(6就是考察隐式转换int型变量转化成unsigned int,b成了正数2. b)运行下面的函数会有什么结果?为什么? void foo(void)

3、char string10,str110; int i; for(i=0;i10;i+) str1i = a; strcpy(string, str1); printf(%s,string); 首先搞清strcpy函数的实现方法,char * strcpy(char * strDest,const char * strSrc)if (strDest=NULL)|(strSrc=NULL)throw Invalid argument(s);char * strDestCopy=strDest;while (*strDest+=*strSrc+)!=0);return strDestCopy;由于

4、str1末尾没有0结束标志,所以strcpy不知道拷贝到何时结束printf函数,对于输出char* 类型,顺序打印字符串中的字符直到遇到空字符()或已打印了由精度指定的字符数为止下面是微软的两道笔试题.3. Implement a string class in C+ with basic functionality like comparison, concatenation, input and output. Please also provide some test cases and using scenarios (sample code of using this class)

5、.Please do not use MFC, STL and other libraries in your implementation.我的实现方案如下,这道题真地对c+的主要特性都进行了较好地考察.String.h:#ifndef STRING_H#define STRING_H#include using namespace std;class String public: String(); String(int n,char c); String(const char* source); String(const String& s); /String& operator=(ch

6、ar* s); String& operator=(const String& s); String(); char& operator(int i)return ai; const char& operator(int i) const return ai;/对常量的索引. String& operator+=(const String& s); int length(); friend istream& operator(istream& is, String& s);/搞清为什么将设置为友元函数的原因. /friend bool operator (const String& left,

7、 const String& right);/下面三个运算符都没必要设成友元函数,这里是为了简单. friend bool operator= (const String& left, const String& right); friend bool operator!= (const String& left, const String& right); private: char* a; int size;#endifString.cpp:#include String.h#include #include String:String() a = new char1; a0 = 0; s

8、ize = 0;String:String(int n,char c)a = new charn + 1;memset(a,c,n);an = 0;size = n;String:String(const char* source)if(source = NULL)a = new char1;a0 = 0;size = 0;else size = strlen(source);a = new charsize + 1;strcpy(a,source);String:String(const String& s)size = strlen(s.a);/可以访问私有变量.a = new chars

9、ize + 1;/if(a = NULL)strcpy(a,s.a);String& String:operator=(const String& s)if(this = &s)return *this;elsedelete a; size = strlen(s.a);a = new charsize + 1;strcpy(a,s.a);return *this;String:String()delete a;/ String& String:operator+=(const String& s) int j = strlen(a); int size = j + strlen(s.a); c

10、har* tmp = new charsize+1; strcpy(tmp,a); strcpy(tmp+j,s.a);delete a;a = tmp;return *this;int String:length()return strlen(a);main.cpp:#include #include String.husing namespace std;bool operator=(const String& left, const String& right)int a = strcmp(left.a,right.a); if(a = 0)return true;elsereturn

11、false;bool operator!=(const String& left, const String& right)return !(left = right);ostream& operator(ostream& os,String& s)int length = s.length();for(int i = 0;i length;i+)/os s.ai;这么不行,私有变量.os si;return os;String operator+(const String& a,const String& b)String temp;temp = a;temp += b;return tem

12、p;bool operator(const String& left,const String& right)int j = 0;while(leftj != 0) & (rightj != 0)if(leftj (const String& left, const String& right) int a = strcmp(left.a,right.a); if(a 0)return true;elsereturn false;istream& operator(istream& is, String& s)delete s.a;s.a = new char20;int m = 20; ch

13、ar c;int i = 0;while (is.get(c) & isspace(c); if (is) dos.ai = c; i+; /*if(i = 20) cout Input too much characters! f;/需要输入.String g;g = a + b;/abcdwwwif(a b)cout a b endl;elsecout = b endl;if(e = a)cout e = a endl;elsecout e != a endl;b += a;cout a endl;cout b endl; cout c endl;cout d endl;cout e en

14、dl;cout f endl;cout g endl;cout g0 endl;return 0;4. Implement a single-direction linked list sorting algorithm. Please first define the data structure of linked list and then implement the sorting algorithm. 5.编写一个函数,返回两个字符串的最大公串!例如,“adbccadebbca”和“edabccadece”,返回“ccade”联想笔试题1设计函数 int atoi(char *s)。

15、int atoi(const char *nptr);函数说明atoi()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,而再 遇到非数字或字符串结束时(0)才结束转换,并将结果返回。返回值 返回转换后的整型数。#include #include int myAtoi(const char* s)int result = 0;int flag = 1;int i = 0;while(isspace(si)i+;if(si = -)flag = -1;i+;if(si = +)i+;while(si != 0)if(si 9) | (si 0)break;int

16、 j = si - 0;result = 10 * result + j;i+;result = result * flag;return result;int main()char* a = -1234def;char* b = +1234;int i = myAtoi(a);int j = myAtoi(b);printf(%d n,i);printf(%d,j);return 0;2int i=(j=4,k=8,l=16,m=32); printf(“%d”, i); 输出是多少?3解释局部变量、全局变量和静态变量的含义。4解释堆和栈的区别。5论述含参数的宏与函数的优缺点。普天C+笔试题

17、1实现双向链表删除一个节点P,在节点P后插入一个节点,写出这两个函数。2写一个函数,将其中的t都转换成4个空格。3Windows程序的入口是哪里?写出Windows消息机制的流程。4如何定义和实现一个类的成员函数为回调函数?5C+里面是不是所有的动作都是main()引起的?如果不是,请举例。6C+里面如何声明const void f(void)函数为C程序中的库函数?7下列哪两个是等同的int b;A const int* a = &b;B const* int a = &b;C const int* const a = &b;D int const* const a = &b;8内联函数在编

18、译时是否做参数类型检查?void g(base & b) b.play;void main() son s; g(s); return;华为笔试题1请你分别画出OSI的七层网络结构图和TCP/IP的五层结构图。2请你详细地解释一下IP协议的定义,在哪个层上面?主要有什么作用?TCP与UDP呢?3请问交换机和路由器各自的实现原理是什么?分别在哪个层次上面实现的?4请问C+的类和C里面的struct有什么区别?5请讲一讲析构函数和虚函数的用法和作用。6全局变量和局部变量有什么区别?是怎么实现的?操作系统和编译器是怎么知道的?78086是多少位的系统?在数据总线上是怎么实现的?Sony笔试题1完成下

19、列程序*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.#include #define N 8int main() int i; int j; int k; - | | | | | | - return 0;2完成程序,实现对数组的降序排序#include void sort( );int main() int array=45,56,76,234,1,34,23,2,3; /数字任/意给出 sort( ); return 0;void sort( ) _ | | | | |-|3费波那其数列,1,1,2,3,5编写程序求第十项。可以用递归,也可以

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1