Answer: Could you write a small program that will compile in C but not in C++ ? 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.
Could you write a small program that will compile in C but not in C++ ? 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. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
There should not be any Spelling Mistakes.
There should not be any Gramatical Errors.
Answers must not contain any bad words.
Answers should not be the repeat of same answer, already approved.