Thread: Syntax Error!
View Single Post
  #4   Spotlight this post!  
Unread 03-02-2006, 15:36
Jared Russell's Avatar
Jared Russell Jared Russell is offline
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,078
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: Syntax Error!

#define is for CONSTANTS - you want to use a variable such as int or float.

Constants get their value once - you cannot assign them a new one.

Since you seem to be using this data in multiple C files, here is what you need to do:

in tracking.h:

extern int distance_from_wall;

in tracking.c, in the global space (top of file, not inside a function):

int distance_from_wall = 0;

Now your code will work the way you expect.

Last edited by Jared Russell : 03-02-2006 at 15:38.