Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

C%20%20%20Interview%20Questions%20and%20Answers

Question: Differences of C and C++
Could you write a small program that will compile in C but not in C++ ?
Answer:
In C, if you can a const variable e.g.
const int i = 2;
you can use this variable in other module as follows
extern const int i;
C compiler will not complain.

But for C++ compiler u must write
extern const int i = 2;
else error would be generated.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook