Skip to content

Instantly share code, notes, and snippets.

@twslankard
Created February 4, 2013 16:51
Show Gist options
  • Save twslankard/4707932 to your computer and use it in GitHub Desktop.
Save twslankard/4707932 to your computer and use it in GitHub Desktop.
// create a list of flags
std::vector<bool> flags;
for(int i = 0; i < 10; i++)
flags.push_back(false);
// set some flags
flags[1] = true;
flags[3] = true;
flags[4] = true;
flags[8] = true;
// print flags
int counted = 0;
for(int i = 0; i < 10; i++) {
if(counted%4 == 0) std::cout << std::endl;
if(flags[i]) {
std::cout << "Flag" << i << " set.";
counted++;
}
}
@twslankard
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment