Re: C quiz για τους καλοκαιρινούς μήνες

Christos Houtouridis hoo2.ch.pub at gmail.com
Mon Jul 18 16:35:21 EEST 2011


2011/7/18 V13 <v13 at v13.gr>

> On Monday 18 of July 2011, V13 wrote:
> > Xoris to .link.menu prospathei na kanei initialization me basi to proto
> > stoixeio toy union kai exo thn entyposi pos ayto einai standard.
>
> Yeap... einai. Des edo:
>
>
> http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fstrin.htm
>


Thanks Θα το δοκιμάσω μόλις γυρίσω στο γραφείο. Αναγκαζόμουν να δημιουργώ
task που να καλεί απλά τα υπομενού. Και αυτά γιατί ο μάγκας ο compiler έλεγε
τα παρακάτω:

**** copy from MDK-ARM doc******
Designated initializers

In C90, there is no way to initialize specific members of arrays,
structures, or unions. C99 supports the initialization of specific members
of an array, structure, or union by either name or subscript through the use
of designated initializers. For example:

typedef struct
{
    char *name;
    int rank;
} data;
data vars[10] = { [0].name = "foo", [0].rank = 1,
                  [1].name = "bar", [1].rank = 2,
                  [2].name = "baz",
                  [3].name = "gazonk" };

Members of an aggregate that are not explicitly initialized are initialized
to zero by default.

Το οποίο στην δικιά μας περίπτωση δεν έκανε και πολύ δουλειά.

Χρήστος
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hellug.gr/pipermail/linux-greek-users/attachments/20110718/d4ddaacd/attachment.html>


More information about the Linux-greek-users mailing list