C ++ toupper () - C ++ standaardbibliotheek

De functie toupper () in C ++ converteert een bepaald teken naar hoofdletters.

toupper () Prototype

 int toupper (int ch);

De toupper()functie converteert ch naar zijn hoofdletterversie als deze bestaat. Als de hoofdletterversie van een teken niet bestaat, blijft deze ongewijzigd. De kleine letters van a tot z worden respectievelijk omgezet in hoofdletters van A tot Z.

Het gedrag van toupper()is niet gedefinieerd als de waarde van ch niet kan worden weergegeven als unsigned char of niet gelijk is aan EOF.

Het wordt gedefinieerd in header-bestand "> header-bestand.

toupper () Parameters

ch: het teken dat moet worden geconverteerd

toupper () Retourwaarde

De toupper()functie retourneert een hoofdletterversie van ch als deze bestaat. Anders retourneert het ch.

Voorbeeld: hoe de functie toupper () werkt

 #include #include #include #include using namespace std; int main() ( char str() = "John is from USA."; cout << "The uppercase version of "" << str << " " is " << endl; for (int i=0; i 

When you run the program, the output will be:

 The uppercase version of "John is from USA." is JOHN IS FROM USA.

Interessante artikelen...