[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?

From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?
Date: Sun, 18 Sep 2005 22:02:29 +0200

On Sun, 2005-09-18 at 21:20 +0200, Anton Erasmus wrote:
> You need to define the actual variable once, and then need an extern
> directive for the other modules. You can do the following. There are
> variantions on this, but I found this to be clear and easy to mix
> initalised and unitialised global variables.

Thanks for the further comments Anton, will investigate ;-)

Now I am having problems using "printf" with my strings... 

if I do : printf("blah blah") it works perfectly, but if I try to use
the array of strings I just defined as constants in ui.c, well it
doesn't work quite as well sadly...

for example :

void main(void)

const char a[] = "test";
printf("%s", a);


works fine, but  : 

void main(void)

printf("%s", param_list[0].desc);


will compile perfectly, but it will not display anything...

Do I need to use some variant of the printf function when displaying
data declared with the __ATTR_PROGMEM__ attribute ? Doesn't the compiler
take care of this automatically ? 

Sorry to trouble you all again ! ;-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]