Skip to content

Instantly share code, notes, and snippets.

@Artanis
Created April 8, 2010 21:17
Show Gist options
  • Save Artanis/360556 to your computer and use it in GitHub Desktop.
Save Artanis/360556 to your computer and use it in GitHub Desktop.
#include<iostream> // for toupper()
#include<cstring> // for strlen()
using namespace std;
int main() {
char ch[] = "Character Array";
// get the length of the
int len = strlen(ch);
cout << ch << "\n";
// loop through the array and use toupper() on each character.
for (int i = 0; i < len; i++) {
ch[i] = toupper(ch[i]);
}
cout << ch << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment