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

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

Fwd: [avr-gcc-list] C Escape sequence.


From: dimax un
Subject: Fwd: [avr-gcc-list] C Escape sequence.
Date: Sat, 17 Jun 2006 20:38:04 +0200

The plain old ANSI C has option of putting octal numbers in strings like \ooo.
For example: "Hello\007World" is actually: {'h' 'e' 'l' 'l' 'o' 0x07 'W' 'o' 'r' 'l' 'd' 0x00}
It is less nice but much more portable.
 

 
On 6/13/06, Joerg Wunsch <address@hidden > wrote:
"justin joseph" < address@hidden> wrote:

>> const char messg[] PROGMEM= "Temp=   \xdf" "C";

> should'nt the array be declared as const unsigned char

Definately not.  The data type of a character is "char", the data type
of a character string literal is "const char *".  For printable
characters, signedness does not matter.  The standard leaves it open
whether the data type "char" is signed or unsigned (and for GCC, you
can decide yourself using -fsigned-char or -funsigned-char).

--
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


reply via email to

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