View Single Post
  #8   Spotlight this post!  
Unread 29-01-2007, 22:21
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: Pointers/References?

Also, you can prevent global variables from being accessed outside of their file by declaring them as static. For example:

In user_routines_fast.c:
Code:
static int auto_counter;

void User_Autonomous_Code(void)
{
    ...
In user_routines.c:
Code:
extern int auto_counter; /* This will not compile! */
It is important to note that the static qualifier has a different meaning if you use it in the scope of a function.
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.