??? 05/26/10 18:58 Read: times |
#176203 - strings in C Responding to: ???'s previous message |
Well, strings in C are one character longer than the number of characters within the "", as there is the null character automatically appended. Thus, you shall not try to initialize an a[4] array with "WD4-", as it won't fit. The compiler is kind enough to strip the extra null as it won't fit (so the result is what you expect); but it is also kind enough to warn about it.
If Keil won't warn about this, Keil is crap. JW |