![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C和C++面试笔试题
文章平均质量分 78
wangleide414
我现在是一名学生。还没有太多的实战经验。只是对JAVA特别感兴趣。我的性格不是很外向。很爱交朋友。
展开
-
C,C++常见面试笔试题-01(编程基础)
1 编程基础1.1 基本概念1.理解:const char*, char const*, char*const的区别问题几乎是C++面试中每次 都会有的题目。 事实上这个概念谁都有只是三种声明方式非常相似很容易记混。 Bjarne在他的The C++ Programming Language里面给出过一个助记的方法: 把一个声明从右向左读。 constchar * con...原创 2012-08-19 13:44:05 · 85 阅读 · 0 评论 -
Linux C语言常用函数 04
函数名: hypot 功 能: 计算直角三角形的斜边长 用 法: double hypot(double x, double y); 程序例: #include ; #include ; int main(void) { double result; double x = 3.0; double y = 4.0...原创 2012-08-31 12:17:45 · 147 阅读 · 0 评论 -
Linux C语言常用函数 05
函数名: poke 功 能: 存值到一个给定存储单元 用 法: void poke(int segment, int offset, int value); 程序例: #include ; #include ; int main(void) { clrscr(); cprintf("Make sure the scroll...原创 2012-08-31 12:17:32 · 181 阅读 · 0 评论 -
Linux C语言常用函数 06
函数名: setbkcolor 功 能: 用调色板设置当前背景颜色 用 法: void far setbkcolor(int color); 程序例: #include ; #include ; #include ; #include ; int main(void) { /* select a driver and mo...原创 2012-08-31 12:17:14 · 244 阅读 · 0 评论 -
Linux C语言常用函数 02
函数名: detectgraph 功 能: 通过检测硬件确定图形驱动程序和模式 用 法: void far detectgraph(int far *graphdriver, int far *graphmode); 程序例: #include ; #include ; #include ; #include ; /* names of the various...原创 2012-08-29 09:53:52 · 195 阅读 · 0 评论 -
Linux C语言常用函数 01
函数名: abort 功 能: 异常终止一个进程 用 法: void abort(void); 程序例: #include ; #include ; int main(void) { printf("Calling abort()\n"); abort(); return 0; /* This is never reached */ } 函数名...原创 2012-08-29 09:53:13 · 172 阅读 · 0 评论 -
C++笔试题
1、C++的类和C里面的struct有什么区别? 答:struct和class的区别在于C里面的struct没有定义方法,而C++的类是将不同类型的数据和与这些数据相关的操作封装在一起的集合体,包含了操作方法。2、请说出const与#define相比,有何优点? 答:const常量有数据类型,而宏常量没有数据类型。编译器可以对前者进行类型安全检查。而对后者只进行字符替换,没有类型安...原创 2012-08-29 09:48:16 · 104 阅读 · 0 评论 -
C 笔试面试题
1、堆栈溢出一般是由什么原因导致的? 答:没有回收垃圾资源。 2、关键字static的作用是什么? 答:在C语言中,关键字static有三个明显的作用:(1)在函数体,一个被声明为静态的变量在这一函数被调用过程中维持其值不变。(2)在模块内,一个被声明为静态的变量可以被模块内所用函数访问,但不能被模块外其它函数访问。它是一个本地的全局变量。(3)在模块内,一个被声明为静态的函数只可...原创 2012-08-28 14:08:49 · 104 阅读 · 0 评论 -
C,C++常见面试笔试题-04(常见)
1.求下面函数的返回值(微软)int func(x) { int countx = 0; while(x) { countx ++; x = x&(x-1); } return countx; } 假定x = 9999。 答案:8思路:将x转化为2进制,...原创 2012-08-19 13:53:46 · 133 阅读 · 0 评论 -
C,C++常见面试笔试题-03(高质量编程)
3 高质量编程C/C++一、请填写BOOL , float, 指针变量与“零值”比较的 if 语句。(10 分)请写出 BOOL flag 与“零值”比较的 if 语句。(3 分)标准答案:if ( flag )if ( !flag )如下写法均属不良风格,不得分。if (flag == TRUE)if (flag == 1 )if (flag == FA...原创 2012-08-19 13:50:04 · 113 阅读 · 0 评论 -
C,C++常见面试笔试题-02(网络)
2网络知识2.1 OSI和TCP/IP1.的七层网络结构图(功能及特点)OSI1) 物理层:为数据链路层提供物理连接,在其上串行传送比特流,即所传送数据的单位是比特。此外,该层中还具有确定连接设备的电气特性和物理特性等功能。2) 数据链路层:负责在网络节点间的线路上通过检测、流量控制和重发等手段,无差错地传送以帧为单位的数据。为做到这一点,在每一帧中必须同时带有同步、...原创 2012-08-19 13:46:46 · 95 阅读 · 0 评论 -
Linux C语言常用函数 03
函数名: gcvt 功 能: 把浮点数转换成字符串 用 法: char *gcvt(double value, int ndigit, char *buf); 程序例: #include ; #include ; int main(void) { char str[25]; double num; int sig = 5; /* significant...原创 2012-08-31 12:17:58 · 150 阅读 · 0 评论