C toperper () - C standarta bibliotēka

Funkcija toupper () pārvērš mazos burtus par lielajiem, ja nodotais arguments ir mazais alfabēts.

C toperper () prototips

 int toupper (int arg);

Funkcija toupper () vesela skaitļa formā ieņem vienu argumentu un atgriež veida vērtību int.

Lai gan toupper () kā argumentu ņem veselu skaitli, funkcijai tiek nodota rakstzīme. Iekšpusē rakstzīme tiek konvertēta uz atbilstošo ASCII vērtību pārbaudei.

Ja nodotais arguments nav mazais alfabēts, tas atgriež to pašu rakstzīmi, kas nodota funkcijai.

Tas ir definēts galvenes failā.

Piemērs: funkcija C toupper ()

 #include #include int main() ( char c; c = 'm'; printf("%c -> %c", c, toupper(c)); // Displays the same argument passed if other characters than lowercase character is passed to toupper(). c = 'D'; printf("%c -> %c", c, toupper(c)); c = '9'; printf("%c -> %c", c, toupper(c)); return 0; ) 

Rezultāts

 m -> MD -> D 9 -> 9

Interesanti raksti...