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

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

Re: [avr-gcc-list] AVR-GCC-list Digest, Vol 114, Issue 1


From: Jim Wagner
Subject: Re: [avr-gcc-list] AVR-GCC-list Digest, Vol 114, Issue 1
Date: Sun, 6 Jul 2014 09:25:08 -0700

Big Difference. The first defines an array of characters and initializes it 
with the string "Hello There". In doing so, it even determines the size of the 
array for you. Note:  there is one more character than you might expect because 
every C string ends with a null character that you don't see.

The second does not even define a variable. A char just holds one character. 
But, you have not even specified a variable that the type char applies to. 

The two are totally different.

Jim Wagner
Oregon Research Electronics

On Jul 6, 2014, at 9:00 AM, address@hidden wrote:

> Send AVR-GCC-list mailing list submissions to
>       address@hidden
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> or, via email, send a message with subject or body 'help' to
>       address@hidden
> 
> You can reach the person managing the list at
>       address@hidden
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AVR-GCC-list digest..."
> 
> 
> Today's Topics:
> 
>   1. String declaration query (Royce Pereira)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 6 Jul 2014 18:33:40 +0530
> From: Royce Pereira <address@hidden>
> To: "address@hidden" <address@hidden>
> Subject: [avr-gcc-list] String declaration query
> Message-ID:
>       <address@hidden>
> Content-Type: text/plain; charset=UTF-8
> 
> Hi,
> 
> What is the differenence between:
> 
> __flash const char myString[] = "Hello There!" ;
> 
> and
> 
> __flash const char *myString = "Hello There!" ;
> 
> AFAIK, both should be same, but the 2nd gives the error:
> 
> " ... initializer element is not computable at load time"
> 
> Am I writing it wrong ?
> 
> Thanks.
> -- 
> Best Regards,
> 
> -- Royce Pereira
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 
> 
> End of AVR-GCC-list Digest, Vol 114, Issue 1
> ********************************************




reply via email to

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