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

const

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







const
PostPosted: Tue Feb 03, 2004 9:06 am     Reply with quote

What const does when it was before a variable?
I tried it and does weird things.

thank you

Marcus
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

PostPosted: Tue Feb 03, 2004 9:10 am     Reply with quote

Hi

The qualifier const tells the compiler, that this 'variable' mustn't be changed so e.g. this is not allowed:

const int var;

var = 4; // not allowed because var is declared as const

What do you mean with "weird things"?

mfg
Felix
Marcus
Guest







const
PostPosted: Tue Feb 03, 2004 9:13 am     Reply with quote

this is suppose to function the same way that a regular variable? When i put const, my var doesn't do the right things.
Marcus
Guest







Re: const
PostPosted: Tue Feb 03, 2004 9:29 am     Reply with quote

Marcus wrote:
this is suppose to function the same way that a regular variable? When i put const, my var doesn't do the right things.


it print 2 times the char in my var char[38][2] on the lcd and when i dont put const it work correctly
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