View Single Post
  #2   Spotlight this post!  
Unread 02-02-2006, 16:55
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: #define creation

I'm a little confused by your question, but this is how you correctly define a constant in a header and then use it in a C file

my_header.h
Code:
#define MY_CONSTANT 1
my_file.c
Code:
#include "my_header.h"
int x  = MY_CONSTANT;
There's not really much more to it than that.