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

Where are constants allocated depending on how you use them?

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



Joined: 17 Jan 2006
Posts: 66

View user's profile Send private message

Where are constants allocated depending on how you use them?
PostPosted: Fri Oct 20, 2006 6:04 am     Reply with quote

Hello All,
I have a little little question.
Let's imagine this two pieces of code:

Code:
printf(lcd_putc, "THIS IS A CONSTANT STRING");


Code:
const char String[] = "THIS IS A CONSTANT STRING";
printf(lcd_putc, "%s", String);


The result will be the same but, in the second case I'm sure the string will be allocated in Program Memory, but... where is the string allocated in the first case????

Thanks in advance,

Juanma
Ttelmah
Guest







PostPosted: Fri Oct 20, 2006 9:48 am     Reply with quote

Exactly the same way.

Best Wishes.
Neckruin



Joined: 17 Jan 2006
Posts: 66

View user's profile Send private message

PostPosted: Mon Oct 23, 2006 1:10 am     Reply with quote

THANKS A LOT!!!! Very Happy
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