C++ Interview Questions - Blue Star

1. What is the difference between a pointer and a reference?
2. The relationship of inheritance in a class is like:
a) IS A
b) HAS A
c) Are A
d) Have A

3. What is the difference between structure and class in C++?

a) By default public
b) By default private
c) Both a and b
d) access specifiers

4. What does a default parameter implies in C++?
5. What is a virtual function?
6. How to use a virtual function explain it with an example?
7. What is multiple inheritance?
8. What is the output of the following program?

void main()
extern int a;

a) linker error- a not defined
b) print 10
c) give compiler error
d) None of the above

9. Find out the error in the program?
int a[10];
Post your comment