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 support@ccsinfo.com

declaring int 32 array -assigning values , problem

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







declaring int 32 array -assigning values , problem
PostPosted: Sun Jan 21, 2007 6:33 pm     Reply with quote

hello, Im new to c programming with PICs and im having a problem , maybe its simple.the code:
Code:

int32 const k[4];               

   k[0]=2253902;
   k[1]=73593237;               
   k[2]=0;
   k[3]=3;


on trying to assign alues to array k i get an 'expecting ( or ,' error
please advise.[/list]
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 21, 2007 7:25 pm     Reply with quote

Constant data is stored in ROM. You can't initialize a 'const' array at
runtime. You can only initialize it at compile time. This is done by
specifying the array elements in a list contained within braces.
See the following post for an example:
http://www.ccsinfo.com/forum/viewtopic.php?t=18391&start=6
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