Convert a string to uppercase. : string function « Data Types « C++ Tutorial






#include <iostream> 
#include <cstring> 
#include <cctype>  
using namespace std; 
 
int main() 
{ 
  char str[80]; 
  int i; 
 
  strcpy(str, "this is a test"); 
 
  for(i=0; str[i]; i++) str[i] = toupper(str[i]); 
 
  cout << str; 
 
  return 0; 
}
THIS IS A TEST








2.24.string function
2.24.1.Using strcpy()
2.24.2.Using strncpy()
2.24.3.strcpy, strlen, strcmp, strcat
2.24.4.Convert a string to uppercase.
2.24.5.Using strcat and strncat.
2.24.6.Using strcmp and strncmp
2.24.7.Using strtok
2.24.8.Using strlen