Language Lawyer in a C++ Job Interview
by Curtis Krauskopf
Language Lawyer questions involve C++ language issues that are typically not seen in
day-to-day programming projects. The questions might probe dark corners of
the language definition or areas that are supported differently between
different popular compilers.
- Show an example of a valid C program that fails to compile in C++.
- Show an example of a valid C program that compiles cleanly in C++ but gives a
different result.
- Why won't this compile?
for (int i = 0; i < 10; i++) {
for (int k = 0; k < 10; k++) {
if (e == 0) goto next_i;
}
next_i;
}
|
- A placement new exists in the C++ language. Is there a "placement delete"?
|