isupper
描述 (Description)
它检查字符是否为大写字母,其他语言环境可能将不同的字符选择视为大写字符,但从不为iscntrl,isdigit,ispunct或isspace返回true的字符。
声明 (Declaration)
以下是std :: isupper的声明。
C++98
int isupper ( int c );
C++11
int isupper ( int c );
参数 (Parameters)
c - 要检查的字符,转换为int或EOF。
返回值 (Return Value)
它返回一个不等于零的值。
异常 (Exceptions)
No-throw guarantee - 此函数永远不会抛出异常。
例子 (Example)
在下面的示例中为std :: isupper。
#include <stdio.h>
#include <ctype.h>
int main () {
int i=0;
char str[]="IoWiki india pvt ltd.\n";
char c;
while (str[i]) {
c=str[i];
if (isupper(c)) c=tolower(c);
putchar (c);
i++;
}
return 0;
}
样本输出应该是这样的 -
iowiki india pvt ltd.