Le 10/06/2013 10:15, al_bin a écrit :
> Yes, number in second [] is necessery. Why?
Here is what I think, which may or may not be correct:
Because in C a 2-dimensional array is defined as an array of arrays.
Which is the same as a pointer to array.
And you can't have pointer to undefined types,
W dniu 2013-06-10 10:46:56 użytkownik Maarten Brock
napisał:
> If SDCC requires the second char then that is a bug.
Second char isn't required.
> Even if SDCC accepts the second char it is a bug.
That is I point out, less explicit than you ;-)
>
> The C standard requires that only the first
> W dniu 2013-06-10 00:53:12 użytkownik Antonio Todo Bom
> napisaÅ:
> YES !
> But almost that:
>
> const char * const menu_str[][] = ...
>
> const char * const char menu_str[5][2] =...
>
> char identifier was missing, and we need to declare the number of itens or
> will note compile.
>
> And Hen
W dniu 2013-06-10 00:53:12 użytkownik Antonio Todo Bom
napisał:
YES !
But almost that:
const char * const menu_str[][] = ...
const char * const char menu_str[5][2] =...
char identifier was missing, and we need to declare the number of itens or will
note compile.
And Henry,
My ta
YES !
But almost that:
> const char * const menu_str[][] = ...
>
>
const char * const char menu_str[5][2] =...
char identifier was missing, and we need to declare the number of itens or
will note compile.
And Henry,
My target device is a PIC18F24K22
Thank you Henry and Marten.
-
Hi Antonio,
Are you targeting MCS51 / 8051? Have you tried the __code directive?
Cheers,
Henry
On Sun, Jun 9, 2013 at 2:58 PM, Antonio Todo Bom wrote:
> Hi dears,
>
> I'm trying to code a table to access strings. My target is produce a routine
> to print menus in dual language.
>
> I wrote:
>
>
> const char *menu_str[][] = {
> { "text1 lang1", "text1 lang2" },
> { "text2 lang1", "text2 lang2" },
> { "textN lang1", "textN lang2" },
> { 0,0 }
> };
Puts an array in RAM that is initialized with pointers to constant
strings. If you want the array to be const as well you'll have to
Hi dears,
I'm trying to code a table to access strings. My target is produce a
routine to print menus in dual language.
*I wrote:*
const char *menu_str[][] = {
{ "text1 lang1", "text1 lang2" },
{ "text2 lang1", "text2 lang2" },
{ "textN lang1", "textN lang2" },
{ 0,0 }
};
*results:*
i