[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    AW: General C++ Question about arrays
From:       "Thomas Kordelle" <Thomas.Kordelle () metechnology ! com>
Date:       1999-08-25 13:26:00
[Download RAW message or body]

Hi,

maybe this one will work. I did never test it!!!!!

numberOfElements = sizeof(myarray) / sizeof(char*)

Tschau

> -----Ursprüngliche Nachricht-----
> Von: Markus Goetz [mailto:guruz@gmx.de]
> Gesendet am: Mittwoch, 25. August 1999 13:58
> An: kde-devel@kde.org
> Betreff: General C++ Question about arrays
>
> Hi,
> i hope i can ask a general c++ question here and you won't kill me :-)
>
> Ok, i have an constant array declared with
> "const static char* myarray[] = { "one", "two", "kde rulez",
> "billy sucks" };"
>
> Now i want to go to the array from element 0 to the last
> element. I am having
> another int constant that has the number of elements.
>
> But i don't want to do this, i want to go from 0 to the last
> element and not to
> 0 to myconstant.
>
> In pascal i would do this with "for a := 0 to high(myarray)
> do .." but in C++ ?
>
> Markus
>
> PS : please help me :-)
>
> --
> Markus Goetz (guruz@gmx.de, http://guruz.tsx.org, icq:23244271)
>
> Der dumme Spruch des Tages (maschinell zufällig ausgewählt) :
> Jemand ohne Windows 95 ist wie ein Fisch ohne Fahrrad.
>
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic