Skip to content

Instantly share code, notes, and snippets.

@danspndl
Created May 8, 2016 14:18
Show Gist options
  • Save danspndl/7e86ae6f3f6396512610412114720dbd to your computer and use it in GitHub Desktop.
Save danspndl/7e86ae6f3f6396512610412114720dbd to your computer and use it in GitHub Desktop.
Convert String to uppercase
#include <iostream>
#include <string>
#include <stdio.h>
#include <ctype.h>
using namespace std;
int main(){
string s="small";
int i=0;
char c2;
while(s[i]){
c2=s[i];
if(islower(c2)){
c2=toupper(c2);
};
cout<<c2;
i++;
};
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment