目录

int toupper(int c)

描述 (Description)

C库函数int toupper(int c)将小写字母转换为大写。

声明 (Declaration)

以下是toupper()函数的声明。

int toupper(int c);

参数 (Parameters)

  • c - 这是要转换为大写的字母。

返回值 (Return Value)

此函数返回等于c的大写,如果存在此值,则c保持不变。 该值作为int值返回,可以隐式转换为char

例子 (Example)

以下示例显示了toupper()函数的用法。

#include <stdio.h>
#include <ctype.h>
int main () {
   int i = 0;
   char c;
   char str[] = "IOWIKI";
   while(str[i]) {
      putchar (toupper(str[i]));
      i++;
   }
   return(0);
}

让我们编译并运行上述程序以产生以下结果 -

TUTORIALS POINT
↑回到顶部↑
WIKI教程 @2018