Redian新闻
>
贴个FLEXTRADE的在线C++测试的题
avatar
贴个FLEXTRADE的在线C++测试的题# JobHunting - 待字闺中
c*2
1
面的是Associate C++ Developer,下面是面试题,光顾着记题了,最后只有56%的通过
率,要到
80%才能ONSITE,算是帮大家做点贡献吧,他家在招人,赶快去投简历
1) #include
using namespace std;
struct A{
A(int value) : m_value(value){}
int m_value;
};
struct B:A {
B(int value):A(value){}
};
int main(){
try {
try{
throw B(5);
}
catch(A a){
a.m_value *=2;
throw;
}
catch(B b){
b.m_value -=2;
throw b;
}
}
catch(A a){
std::cout << a.m_value;
}
return 0;
}
output?
2)how to declare a pointer to class member
3) #include
using namespace std;
struct Foo{
Foo() {std::cout <Foo(int i) {std::cout <Foo(char c) {std::cout <Foo(long l) {std::cout <Foo(float f) {std::cout<};
int main(){
Foo f1('a');
Foo f2('a'+1);
Foo f3(1);
Foo f4(0x01);
Foo f5(0X0001L);
Foo f6(1.0f);
system("pause");
return 0;
}
output?
4) #include
using namespace std;
int main(){
int a = 2|1;
cout << a;
system("pause");
return 0;
}
5)
class X{
public:
X& operator=(const X& rhs);
const X& operator+(const X&rhs) const;
const X& operator+(int m);
private:
int n;
};
int main(){
X a, b, c;
system("pause");
return 0;
}
which one is wrong?
a=c+5;
a=a=b+c;
(a=c+4)=b+2;
a=b+c;
b=a+1;
6) class foo{
public:
foo(int i){}
};
class bar: virtual foo{
public:
bar(){}
};
bar b;
what's wrong with the above code?
7) class deriv2: public mybase, devive1{}
is this correct?
8) ++ operator overload prefix & postfix, dummy parameter, both
prefix&postfix
forget....
9) int main(){
int c=0;
if(c=(c!=1)){}
cout <system("pause");
return 0;
}
output?
10)int main(){
int a=5;
int b=a++;
int c=++a;
a=b*c;
cout <system("pause");
return 0;
}
output?
11) template<> class Stack
{
public:
int push(char);
char pop();
};
what template<> signify in this exmple class ?
template queue
default template initialization
emplty template declaration
others
12) F00
| |
BAR BAR2
| |
FOOBAR FOOBAR2
dynamic cast foo to children
avatar
t*r
2
nice
avatar
g*v
3
mark下
avatar
m*l
4
re
avatar
A*i
5
百分之40多的路过,当年年轻气盛啥都没复习就直接上,直接傻眼
感觉flextrade要求C++功底很深厚啊
avatar
x*n
6
5) 貌似几个选择都是对的?
7)和12)哪位牛人给指导一下阿
avatar
c*2
7

我好几道题都是用编译器做的还得这点分呢
现在工作真是难找啊,sign~

【在 A*****i 的大作中提到】
: 百分之40多的路过,当年年轻气盛啥都没复习就直接上,直接傻眼
: 感觉flextrade要求C++功底很深厚啊

avatar
a*n
8
这题跟功力没关系, 都是一个题库的, 记住答案就行了

【在 A*****i 的大作中提到】
: 百分之40多的路过,当年年轻气盛啥都没复习就直接上,直接傻眼
: 感觉flextrade要求C++功底很深厚啊

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。