JP Morgan phone interview questions# JobHunting - 待字闺中
t*t
1 楼
The guy was very nice, asked me about my research and other stuff in the
resume (I'm wrapping up my PhD in CS).
He asked the following C++/C questions:
1. What's wrong with the following lines of code? Does it complie? If yes,
any problems?
class A { ... };
class B : public A { ... } // definitions of classess, these are OK
Foo() {
A & a = B(); // ??
A * p = &B(); // ??
.......
}
2. If I use malloc to get a piece of memory :
char * p = (char*)malloc (1000);
now I found that I need m
resume (I'm wrapping up my PhD in CS).
He asked the following C++/C questions:
1. What's wrong with the following lines of code? Does it complie? If yes,
any problems?
class A { ... };
class B : public A { ... } // definitions of classess, these are OK
Foo() {
A & a = B(); // ??
A * p = &B(); // ??
.......
}
2. If I use malloc to get a piece of memory :
char * p = (char*)malloc (1000);
now I found that I need m