[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Bizarre string problem
From: |
Ned Konz |
Subject: |
Re: [avr-gcc-list] Bizarre string problem |
Date: |
Mon, 6 Sep 2004 07:30:19 -0700 |
User-agent: |
KMail/1.7 |
On Sunday 05 September 2004 11:31 pm, Ian Caddy wrote:
> In your code snippet, why do you use "T" instead of 'T' for the
> character array.
because it's legal C and your response isn't?
> The code snippet should look like:
>
> char t[1] = 'T';
> UDR = t[0];
Actually, if you want to use character constants to initialize, you need to do
this:
char t[1] = { 'T' };
or this:
char t[1] = "T";
or if you want the NUL too:
char t[2] = "T";
--
Ned Konz
http://bike-nomad.com
Re: [avr-gcc-list] Bizarre string problem, Joerg Wunsch, 2004/09/09