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

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

[avr-gcc-list] Program Space String Utility - winavr20030312 - sizeof v


From: Loc Mai
Subject: [avr-gcc-list] Program Space String Utility - winavr20030312 - sizeof vs strlen
Date: Fri, 11 Apr 2003 09:55:41 -0400

Oh,
typo error.
Now I understand it by experiment:

static uint8_t PROGMEM leds[]={0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0,
0x80, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0x00};

result is:              sizeof(leds) = 17.
Meanwhile    strlen_P(leds) = 96. It does not matter if 0x00 stays anywhere
in array.

I will try (sizeof(leds)/sizeof(leds[0])) this weekend.
Anyway thanks Tod and Eric.
Cheers.
Loc




reply via email to

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