Tuesday, December 28, 2010

rules about global variables

I ran into a weird problem where a function couldn't see a variable that I thought was considered global. Turns out I forgot that variables declared in main aren't considered global - just local to main. You have to declare them before main.

No comments:

Post a Comment