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

This is very a basic question

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







This is very a basic question
PostPosted: Thu Oct 28, 2004 9:40 am     Reply with quote

Hello everyone,
What do you call this declaration:

int tmp = 0; // where tmp is declared and given a value right away?
..

and is this okay with CCS compilers ?

Thank you.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 28, 2004 10:01 am     Reply with quote

Not sure what you would call it. You have declared and initialialise a variable. And yes it is a valid construct.
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Thu Oct 28, 2004 1:07 pm     Reply with quote

I think it's called agitate initialisation.

Will
William H. Conley III



Joined: 27 May 2004
Posts: 17
Location: Tucson, AZ

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 28, 2004 2:20 pm     Reply with quote

Yes, that will work.

It will init the value to '0'

You can int the value to any number between 0 and 255

byte test = 2;
short tbit = 1;
long int testl = 123;
_________________
- Bill
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