Is this a recurring theme in college?
In my data structures class (in Java, which is fine by me, memory management is a hell of a lot easier when you don't have to free memory), the teacher said a few things that I thought were off.
First, he talked about using vectors in java, despite how they are now deprecated in the API (ArrayLists are now preferred). Second, he described bools in C++ as "just an enumeration." (although they may have been implemented that way years ago in bool.h, that is before my time) I believe they are as much a part of standard C++ as booleans are of Java. Finally, he said a code fragment like this would cause a runtime error (this is java), like a hanging reference in C/C++ (returning a pointer to a variable on the stack in a local function).
Code:
static int func() {
for (int i = 0; i < 10; i++);
return i;
}
I instead thought it would be a compile time error, as i is simply out of scope, to which he responded "That would be nice, but I don't think it happens that way." On my compiler, indeed, it causes a compile time error.