Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Select your favorite languages :
  • Or search :

Idiom #244 Print map

Print the contents of map m to the standard output: keys and values.

#include <map>
#include <iostream>
for (auto elem : m) {
	std::cout << elem.first << ": " << elem.second << "\n";
}
fmt.Println(m)
console.log(m);
import java.util.Map;
System.out.println(m);
uses Generics.Collections;
for APair in m do writeln(APair.Key, APair.Value);
print(m)
puts m
println!("{:?}", m);

New implementation...