CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

global variable scope

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mshearer



Joined: 12 Jan 2009
Posts: 33

View user's profile Send private message

global variable scope
PostPosted: Thu Feb 05, 2009 2:50 am     Reply with quote

Hi,
I'm having a bit of a problem which may relate to a variable not being global for all source files.

I have a structure declared in main.c
Code:
extern STATUS_TABLE_TYPE   status_table;

Then when I try and access some of the elements of the structure from a different source file, I get
Quote:
Expecting a structure/Union status_table

Any help would be great
thanks,
Matt
mshearer



Joined: 12 Jan 2009
Posts: 33

View user's profile Send private message

PostPosted: Thu Feb 05, 2009 2:58 am     Reply with quote

Works now if I declare it from a header file. Perhaps the order it's called in is affecting it or something.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group