C 庫函數 int toupper(int c) 把小寫字母轉換為大寫字母。
如果 c 有相對應的大寫字母,則該函數傳回 c 的大寫字母,否則 c 保持不變。
傳回值是一個可被隐式轉換為 char 類型的 int 值。
#include <stdio.h>
#include <ctype.h>
int main()
{
int i = 0;
char c;
char str[] = "runoob";
while(str[i])
{
putchar (toupper(str[i]));
i++;
}
return(0);
}