Autor Beitrag
Nano-Ware
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 7



BeitragVerfasst: Mi 11.04.12 13:19 
Hey,

kann man mit dem C++ Builder auch per for in Schleife durch eine StringList itarieren? Quasi so:
ausblenden Quelltext
1:
for (String s in StringL) {}					

Danke!


Moderiert von user profile iconTh69: Titel geändert: itarieren -> iterieren
Moderiert von user profile iconTh69: Code-Tags hinzugefügt
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mi 11.04.12 13:57 
Hallo,

da C++ keine foreach-Schleife kennt, kannst du einfach mit einer normalen Index-Schleife arbeiten:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
for(int i=0; i<stringList->Count; i++)
{
   String s = stringList[i];

   // ...
}
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Mi 11.04.12 16:10 
Der Vollständigkeit halber: C++11 kann das, nur kann der C++ Builder kein C++11.

_________________
>λ=