I'm new to C++, though I've programmed in scripting languages like PHP and Perl. I've got a very simple piece of code, that I actually got from a tutorial, that I just cannot get to work.
It compiles, but throws an access violation whenever I try to read from the struct:
Can anyone tell me what's going on? It's a global variable, so it should exist in main(), right? I think I must be fundamentally misunderstanding something, but the above code came from, like I said, a tutorial on C++, and I've been searching all day and can't figure it out.