linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randi Botse <nightdecoder@gmail.com>
To: Michal Nazarewicz <mina86@tlen.pl>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: C Question
Date: Sun, 30 May 2010 17:41:18 +0700	[thread overview]
Message-ID: <AANLkTilJ0HUomkRuJwrywTcmVoeAAmQb2MTZbwoT57fn@mail.gmail.com> (raw)
In-Reply-To: <87r5l09pjt.fsf@erwin.mina86.com>

Yes, the N_(x) macro used for localization that i discard in my question.

Sorry but, i just having another question, consider this code:

const char *my_strings[] = {
    [0] = "index0",
    [4] = "index4",
    [6] = "index6"
};

How many pointer to char that my_string array holds now? is that 3?
where are index [1], [2], [3], and [5] ?

2010/5/25 Michal Nazarewicz <mina86@tlen.pl>:
>
> As Xiaotian Feng said, N_(x) must be defined somewhere and additionally
> to this this definition uses a new syntax where you can specify indexes
> of elements you want to set value to, ie. the above is the same as:
>
> const char *virt_types[] = {
>        [0]     = N_("none"),
>        [1]     = N_("para"),
>        [2]     = N_("full")
> };
>
> which in turn is the same as:
>
> const char *virt_types[] = {
>        N_("none"),
>        N_("para"),
>        N_("full")
> };
>
> The advantage of the new syntax is that you can specify values in any
> order and omit some.
>
> --
> Best regards,                                         _     _
>  .o. | Liege of Serenly Enlightened Majesty of      o' \,=./ `o
>  ..o | Computer Science,  Michal "mina86" Nazarewicz   (o o)
>  ooo +--<mina86-tlen.pl>--<jid:mina86-jabber.org>--ooO--(_)--Ooo--
>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-05-30 10:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 10:08 C Question Randi Botse
2010-05-25 10:19 ` Xiaotian Feng
     [not found]   ` <AANLkTinTu94E7guvzjySpGjht2Hjw4aop4vRIVpHo9UL@mail.gmail.com>
2010-05-25 10:49     ` Randi Botse
2010-05-25 11:18 ` Uriel Corfa
2010-05-25 11:41 ` Michal Nazarewicz
2010-05-30 10:41   ` Randi Botse [this message]
2010-05-30 12:38     ` Michal Nazarewicz
2010-06-01 11:59       ` Randi Botse
2010-06-01 13:18         ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTilJ0HUomkRuJwrywTcmVoeAAmQb2MTZbwoT57fn@mail.gmail.com \
    --to=nightdecoder@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=mina86@tlen.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).