avr-gcc-list
[Top][All Lists]
Advanced

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

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


From: Jesper Hansen
Subject: Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?
Date: Sun, 18 Sep 2005 23:47:19 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)



Vincent Trouilliez wrote:
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 ?

look up printf_P in the avr-libc documentation

/Jesper




reply via email to

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