Skip to content

Instantly share code, notes, and snippets.

@lamchau
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lamchau/59173caaf9dc56b2f0a6 to your computer and use it in GitHub Desktop.
Save lamchau/59173caaf9dc56b2f0a6 to your computer and use it in GitHub Desktop.
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
int main() {
// create alphabet (lowercase)
char letters[26];
for (int i = 0; i < 26; i++) {
letters[i] = 'a' + i;
}
string str(letters, 26);
cout << str << endl;
// convert to uppercase
transform(str.begin(), str.end(), str.begin(), ::toupper);
cout << str << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment