View Single Post
  #2   Spotlight this post!  
Unread 01-02-2006, 22:10
Jared Russell's Avatar
Jared Russell Jared Russell is online now
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,070
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Using vars across multiple .c files

define the var as:

extern mytype myvar;

in each file accessing it, except one.

Then, in ONLY ONE file (the only without an extern declaration), declare the variable normally:

mytype myvar;

See http://www.crasseux.com/books/ctutor...variables.html

Last edited by Jared Russell : 01-02-2006 at 22:17.