- 浏览: 490083 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (672)
- 随便写写 (3)
- javascript (16)
- Java exam (58)
- JSP exam (25)
- Servlet exam (25)
- Struts exam (24)
- Spring exam (24)
- Hibernate exam (19)
- EJB exam (25)
- SOA exam (6)
- AJAX exam (25)
- Web开发 exam (25)
- 软件工程 exam (25)
- 项目管理 exam (25)
- .NET exam (23)
- ASP.NET exam (24)
- C# exam (24)
- C++ exam (25)
- C语言 exam (13)
- ASP exam (0)
- PHP exam (0)
- Ruby exam (0)
- Python exam (0)
- Delphi exam (0)
- Linux exam (0)
- UNIX exam (25)
- 数据库 exam (24)
- Oracle exam (25)
- SQL Server exam (20)
- MySQL exam (16)
- Mobile开发 exam (10)
- 嵌入式开发 exam (6)
- 网络安全 exam (0)
- 网络技术 exam (0)
- 综合技术 exam (0)
- HR面试 exam (0)
- 英语面试 exam (0)
- 外企面试 exam (0)
- 软件测试 exam (0)
- QTP exam (0)
- LoadRunner exam (0)
- 网友面经 exam (0)
- 应届生 exam (0)
- 面试指导 exam (0)
- IQ测试 exam (0)
- Flex exam (2)
- uml-ea (1)
最新评论
-
dxking100:
远光没有笔式题的说..
最新远光软件笔试题面试题内容(1) -
heming_way:
谢谢,正在复习软件工程考试呢,呵呵
《软件工程》选择题 -
梅玲达:
可以更详细点吗?
Hibernate中Criteria 和DetachedCriteria的作用是什么? -
buptjian:
学习下,试试看,谢谢啊~
Prototype如何实现页面局部定时刷新? -
bubblegum89:
这个。。。和我笔试时候做的 感觉完全不一样
最新远光软件笔试题面试题内容(3)
39.解释局部变量、全局变量和静态变量的含义。
40.解释堆和栈的区别。
栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。
堆:一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事,分配方式倒是类似于
链表.
41.论述含参数的宏与函数的优缺点。
42. 以下三条输出语句分别输出什么?[C易]
char str1[] = “abc”;
char str2[] = “abc”;
const char str3[] = “abc”;
const char str4[] = “abc”;
const char* str5 = “abc”;
const char* str6 = “abc”;
cout << boolalpha << ( str1==str2 ) << endl; // 输出什么?
cout << boolalpha << ( str3==str4 ) << endl; // 输出什么?
cout << boolalpha << ( str5==str6 ) << endl; // 输出什么?
43. 非C++内建型别 A 和 B,在哪几种情况下B能隐式转化为A?[C++中等]
答:
a. class B : public A { ……} // B公有继承自A,可以是间接继承的
b. class B { operator A( ); } // B实现了隐式转化为A的转化
c. class A { A( const B& ); } // A实现了non-explicit的参数为B(可以有其他带默认值的参数)构造函数
d. A& operator= ( const A& ); // 赋值操作,虽不是正宗的隐式类型转换,但也可以勉强算一个
44. 以下代码中的两个sizeof用法有问题吗?[C易]
void UpperCase( char str[] ) // 将 str 中的小写字母转换成大写字母
{
for( size_t i=0; i<sizeof(str)/sizeof(str[0]); ++i )
if( ‘a'<=str[i] && str[i]<='z' )
str[i] -= ('a'-'A' );
}
char str[] = “aBcDe”;
cout << “str字符长度为: ” << sizeof(str)/sizeof(str[0]) << endl;
UpperCase( str );
cout << str << endl;
45. 以下代码有什么问题?[C难]
void char2Hex( char c ) // 将字符以16进制表示
{
char ch = c/0×10 + ‘0′; if( ch > ‘9′ ) ch += ('A'-'9′-1);
char cl = c%0×10 + ‘0′; if( cl > ‘9′ ) cl += ('A'-'9′-1);
cout << ch << cl << ‘ ‘;
}
char str[] = “I love 中国”;
for( size_t i=0; i<strlen(str); ++i )
char2Hex( str[i] );
cout << endl;
46. 以下代码有什么问题?[C++易]
struct Test
{
Test( int ) {}
Test() {}
void fun() {}
};
void main( void )
{
Test a(1);
a.fun();
Test b();
b.fun();
}
*** Test b();//定义了一个函数
47. 以下代码有什么问题?[C++易]
cout << (true?1:”1″) << endl;
8. 以下代码能够编译通过吗,为什么?[C++易]
unsigned int const size1 = 2;
char str1[ size1 ];
unsigned int temp = 0;
cin >> temp;
unsigned int const size2 = temp;
char str2[ size2 ];
48. 以下代码中的输出语句输出0吗,为什么?[C++易]
struct CLS
{
int m_i;
CLS( int i ) : m_i(i) {}
CLS()
{
CLS(0);
}
};
CLS obj;
cout << obj.m_i << endl;
49. C++中的空类,默认产生哪些类成员函数?[C++易]
答:
class Empty
{
public:
Empty(); // 缺省构造函数
Empty( const Empty& ); // 拷贝构造函数
~Empty(); // 析构函数
Empty& operator=( const Empty& ); // 赋值运算符
Empty* operator&(); // 取址运算符
const Empty* operator&() const; // 取址运算符 const
};
50. 以下两条输出语句分别输出什么?[C++难]
float a = 1.0f;
cout << (int)a << endl;
cout << (int&)a << endl;
cout << boolalpha << ( (int)a == (int&)a ) << endl; // 输出什么?
float b = 0.0f;
cout << (int)b << endl;
cout << (int&)b << endl;
cout << boolalpha << ( (int)b == (int&)b ) << endl; // 输出什么?
51. 以下反向遍历array数组的方法有什么错误?[STL易]
vector array;
array.push_back( 1 );
array.push_back( 2 );
array.push_back( 3 );
for( vector::size_type i=array.size()-1; i>=0; -i ) // 反向遍历array数组
{
cout << array[i] << endl;
}
40.解释堆和栈的区别。
栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。
堆:一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事,分配方式倒是类似于
链表.
41.论述含参数的宏与函数的优缺点。
42. 以下三条输出语句分别输出什么?[C易]
char str1[] = “abc”;
char str2[] = “abc”;
const char str3[] = “abc”;
const char str4[] = “abc”;
const char* str5 = “abc”;
const char* str6 = “abc”;
cout << boolalpha << ( str1==str2 ) << endl; // 输出什么?
cout << boolalpha << ( str3==str4 ) << endl; // 输出什么?
cout << boolalpha << ( str5==str6 ) << endl; // 输出什么?
43. 非C++内建型别 A 和 B,在哪几种情况下B能隐式转化为A?[C++中等]
答:
a. class B : public A { ……} // B公有继承自A,可以是间接继承的
b. class B { operator A( ); } // B实现了隐式转化为A的转化
c. class A { A( const B& ); } // A实现了non-explicit的参数为B(可以有其他带默认值的参数)构造函数
d. A& operator= ( const A& ); // 赋值操作,虽不是正宗的隐式类型转换,但也可以勉强算一个
44. 以下代码中的两个sizeof用法有问题吗?[C易]
void UpperCase( char str[] ) // 将 str 中的小写字母转换成大写字母
{
for( size_t i=0; i<sizeof(str)/sizeof(str[0]); ++i )
if( ‘a'<=str[i] && str[i]<='z' )
str[i] -= ('a'-'A' );
}
char str[] = “aBcDe”;
cout << “str字符长度为: ” << sizeof(str)/sizeof(str[0]) << endl;
UpperCase( str );
cout << str << endl;
45. 以下代码有什么问题?[C难]
void char2Hex( char c ) // 将字符以16进制表示
{
char ch = c/0×10 + ‘0′; if( ch > ‘9′ ) ch += ('A'-'9′-1);
char cl = c%0×10 + ‘0′; if( cl > ‘9′ ) cl += ('A'-'9′-1);
cout << ch << cl << ‘ ‘;
}
char str[] = “I love 中国”;
for( size_t i=0; i<strlen(str); ++i )
char2Hex( str[i] );
cout << endl;
46. 以下代码有什么问题?[C++易]
struct Test
{
Test( int ) {}
Test() {}
void fun() {}
};
void main( void )
{
Test a(1);
a.fun();
Test b();
b.fun();
}
*** Test b();//定义了一个函数
47. 以下代码有什么问题?[C++易]
cout << (true?1:”1″) << endl;
8. 以下代码能够编译通过吗,为什么?[C++易]
unsigned int const size1 = 2;
char str1[ size1 ];
unsigned int temp = 0;
cin >> temp;
unsigned int const size2 = temp;
char str2[ size2 ];
48. 以下代码中的输出语句输出0吗,为什么?[C++易]
struct CLS
{
int m_i;
CLS( int i ) : m_i(i) {}
CLS()
{
CLS(0);
}
};
CLS obj;
cout << obj.m_i << endl;
49. C++中的空类,默认产生哪些类成员函数?[C++易]
答:
class Empty
{
public:
Empty(); // 缺省构造函数
Empty( const Empty& ); // 拷贝构造函数
~Empty(); // 析构函数
Empty& operator=( const Empty& ); // 赋值运算符
Empty* operator&(); // 取址运算符
const Empty* operator&() const; // 取址运算符 const
};
50. 以下两条输出语句分别输出什么?[C++难]
float a = 1.0f;
cout << (int)a << endl;
cout << (int&)a << endl;
cout << boolalpha << ( (int)a == (int&)a ) << endl; // 输出什么?
float b = 0.0f;
cout << (int)b << endl;
cout << (int&)b << endl;
cout << boolalpha << ( (int)b == (int&)b ) << endl; // 输出什么?
51. 以下反向遍历array数组的方法有什么错误?[STL易]
vector array;
array.push_back( 1 );
array.push_back( 2 );
array.push_back( 3 );
for( vector::size_type i=array.size()-1; i>=0; -i ) // 反向遍历array数组
{
cout << array[i] << endl;
}
发表评论
-
C++面试题集(5)
2010-08-12 16:46 72362:8086是多少位的系统? ... -
尝试写出类的成员函数实现
2010-08-12 16:46 793已知String类定义如下:class String{publ ... -
C++算法面试题
2010-08-12 16:46 831算法:1.什么是NPC,NP-Hard?2.起泡排序的时间复杂 ... -
什么是析构函数? 析构函数有什么特点?
2010-08-12 16:46 861概念:1. 与构造函数相对应2. 与构造函数的作用相反3. 析 ... -
g++的常用参数有哪些?
2010-08-12 16:46 600- c 编译成目标文件.o- o指定输出文件名,输出文件名跟在 ... -
构造函数的特点
2010-08-12 16:46 763构造函数只在建立对象的时候自动被调用一次构造函数必须是公共的, ... -
Compiler Related Questions
2010-08-12 16:46 420Q: Dynamic Linking vs Static Li ... -
C/C++笔试题
2010-08-12 16:46 726C/C++:1.C与C++的异同,优劣;2.C,C++,VC, ... -
上海贝尔的面试题43分即可进入复试
2010-08-12 16:46 698一、请填写BOOL , float, 指针变量 与“零值”比较 ... -
常见C++笔试题目整理(含答案)3
2010-08-12 16:46 61621.struct A{char t:4;char k:4;u ... -
常见C++笔试题目整理(含答案)2
2010-08-12 16:46 62611.下面代码有什么问题?Void test3(char* s ... -
常见C++笔试题目整理(含答案)1
2010-08-12 16:46 6971.是不是一个父类写了 ... -
C++面试题集(1)
2010-08-12 16:46 6991 #i nclude “filename.h”和#i ncl ... -
摩托罗拉部分C++面试题
2010-08-12 16:46 7501.介绍一下STL,详细说 ... -
单向链表的反转
2010-08-12 16:46 722单向链表的反转是一个经常被问到的一个面试题,也是一个非常基础的 ... -
C++面试题集(4)
2010-08-12 16:46 57452. 以下代码有什么问题?[STL易]typedef vec ... -
C++面试题集(2)
2010-08-12 16:46 46211 下列哪两个是等同的i ... -
在C++中,class与struct的区别是什么?
2010-08-12 16:46 711struct的缺省作用域为publicclass的缺省作用域为 ... -
介绍一下函数的重载
2010-08-12 16:46 6131. 什么是函数的重载:对于在不同类型上作不同运算而又用同样的 ... -
网上流传的c++笔试题汇总
2010-08-12 16:46 8921.求下面函数的返回值(微软)int func(x){int ...
相关推荐
C++面试题集 DOC C++面试题集 DOC C++面试题集 DOC C++面试题集 DOC C++面试题集 DOC
C++面试题集.pdf
C++面试题(全集)C++面试题(全集)C++面试题(全集)C++面试题(全集)
C++面试题笔试题C++ 数据结构算法笔试题资料合集: 50个C、C++面试题.pdf C++ 数据结构、算法笔试题.docx C++基础面试题.docx C++开发工程师面试题库.docx C++技能测试试卷一及答案.docx C++技能测试试卷二及答案....
个人整理网络c++面试题合集
C++面试题锦集,收集了很多C++面试题,有详解,
C C++笔试面试题合集C C++笔试面试题合集C C++笔试面试题合集C C++笔试面试题合集
C++经典面试题全集,包括了很多经典的面试题!
C\C++面试题集(试题和答案) C\C++面试题集(试题和答案)
C++面试题!
C++面试题全集,涉及华为 三星等
常见C++面试题汇总(最全c语言面试题) 所包含文件: 1、华为C++内部培训材料 2、130道面试题.doc 3、C++试题.htm 4、C-C++ 程序设计员应聘常见面试试题深入剖析.mht 5、C语言面试题大汇总之华为面试题.txt 6、C语言...
c、c++面试题集.pdf,很经典的面试题目!
C++面试题集v6.1.docx
最全的c++面试题集合,都是些经典的公司面试题,当然还有答案。
5、C语言面试题大汇总之华为面试题.txt 6、C语言面试题大汇总之微软亚洲技术中心面试题.txt 7、c语言面试题及答案_1.txt 8、面试题.htm 9、求职笔试面试大全.htm 10、如何回答十个最棘手的面试问题.htm 11、英语面试...
个人收藏的面试集锦: C++面试题集(最全的CC++试题集和答案) c与c++面试题汇总1 c与c++面试题汇总
c++面试题集和答案
C++面试题笔试题 CC++面试问题分类大汇总.docx C语言 gamesloft C++面试题目.docx Google笔试面试 IQ智力面试题笔试题 JAVA笔试面试资料 NET面试题笔试题 web开发 中兴资料 微软笔试面试 数据库面试题笔试题 百度...
C++面试题集,很全的。对于将要找工作的同学们,可以作为参考