home > 比較編 > C, C++, Objective-C, Java, C# > dictionaries >

ForNext

Only Do What Only You Can Do

085. map iterate

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

F#

C

C++

map<string,int>::iterator mi;
for (mi = m.begin(); mi != m.end(); mi++) {
  printf("%s %d", mi->first, mi->second)
}

C++Builder

VC++

C#

foreach ( KeyValuePair<string,int> e in dict) {
   use e.Key and e.Value
}


Java

for ( java.util.Map.Entry<String, Integer> e : m.entrySet() ) {
   use e.getKey() or e.getValue()
}


Objective-C

NSEnumerator *i = [dict keyEnumerator];
id key;
while ((key = [i nextObject])) {
   do something with key
}

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system