Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    I think you should declare the variable type in globals.cpp too, i.e. int x = 1337. int is the default data type so in this case it will probably work, but... Commented Mar 14, 2012 at 12:44
  • nm, I just stumbled over this once and it took me a long time to understand what the compiler actually wanted from me... Commented Mar 14, 2012 at 12:50
  • 5
    @arne: There are no "default data types" in C++. Commented Mar 14, 2012 at 13:01
  • @LightnessRacesinOrbit: OK, I dimly remember that there was something like that in C. If it isn't in C++, I have to revoke my comment. Commented Mar 14, 2012 at 13:19
  • I don't know if this is common or not but I like to call these extern ones "superglobals" Commented Aug 15, 2024 at 13:51