So what was the point of the last quiz?
Well, that's a fairly short one to answer: C++ is a hard language to learn.
Not a single person got #1 completely right (except Promit).
Let's look at the For Beginners forum for a second. Count how many posts you see where the person is asking "what language should I learn?" Finished yet? You won't be finished anytime soon, so let me just give you the answer: A lot.
Now looking at the answers I see an overwhelming majority are: "Learn C++ because... (Various crap)." One of the major contenders for that crap title is: "Because that's what is used in the industry". Having dealt with industry professionals in other mediums before, I can say that they would have scored about as well as most of you who participated in my little quiz did. Learning C++ as a first language is usually a bad choice, IMO, mostly because you get bogged down into the details of the language, instead of learning the concepts of programming.
Now looking over the results, there is one question that everyone got wrong (except one person, who didn't answer it because we had already discussed it previously). That question being the first one. Think about what the question is asking, it seems so obvious to you, so clear cut and simple. But yet the behavior of the second line is completely undefined. It can do anything. However, the majority of you answered that it would just result in a pointer to . Why is this? I think my best guess is the following: You have been taught pointers wrong. At some fundamental level, you have been taught that a pointer is just an integer, and as such operations like adding a number to an integer can't really have any side effect unless you use that integer elsewhere (which that pointer doesn't do). But that is not true. Pointers are NOT integers; as such they don't have all of the properties of integer addition in C++. Other pointer behavior that would be undefined, continuing from the first question: int* l = p - 1; would also be undefined behavior. The only legal range for a pointer that deals with p is: [p, p + 10]. Anything further and you're in the realm of undefined behavior. One might be tempted to say: "Well... on system XYZ that code works fine." But that's not the point of the question. While it may result in predictable behavior on some systems, that doesn't mean it will on all systems. It's just like relying on the VC6 for loop scope issue.
There is a heck of a lot of undefined behavior in C++. Simple things that may seem to be entirely legal can easily fall into the realm of undefined behavior. The classic example of this would be: int h = 10; h = h++;. Think about what you would expect that line to result in? Most people "in the know" will say something like 10, or maybe even 11. Someone who is really in the know will say: "Undefined behavior." You could almost say: You have a better chance of finding a C++ program relying on undefined behavior than you will of finding one that is perfectly compliant. Scary thought, that one.