Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85750430
maps.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Oct 1, 21:09
Size
596 B
Mime Type
text/x-c
Expires
Thu, Oct 3, 21:09 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
21261462
Attached To
R9360 PCSC_git
maps.cpp
View Options
#include <iostream>
#include <map>
enum ParticleType {
planet,
star,
atom,
};
int main() {
std::map<std::string, ParticleType> particle_types;
particle_types["mars"] = planet;
particle_types["sun"] = star;
particle_types["copper"] = atom;
std::map<std::string, ParticleType>::iterator it = particle_types.begin();
std::map<std::string, ParticleType>::iterator end = particle_types.end();
for (; it != end; ++it) {
std::string key = it->first;
ParticleType p_type = it->second;
std::cout << "key:" << key << " -> ";
std::cout << p_type << std::endl;
}
}
Event Timeline
Log In to Comment