Created
April 8, 2010 21:17
-
-
Save Artanis/360556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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