본문 바로가기

Language & API/C_기초

toupper(_In_ int _C) 사용법

선언 

<cctype> or <ctype.h>


정의

_Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl toupper(_In_ int _C);


설명

char 형 소문자를 -> 대문자로 변환시켜 줍니다.

반환값이 Int 입니다.


파라미터 

_In_ int _C : 아스키 코드값(int) or ' ' char 문자 


반환값

Int 형 아스키 코드값 (**문자가 아닙니다.)


예제

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <cctype>
#include <string.h>
#include <iostream>
//#include <windows.h>
 
using namespace std;
 
int main(_In_ int _Argc, _In_reads_(_Argc) _Pre_z_ char ** _Argv, _In_z_ char ** _Env)
{
    char str[] = "hello world!@@";
 
    for (int i = 0; i < strlen(str); i++)
    {
        cout << static_cast<char>(toupper(str[i]));
        //printf("%c", tolower(str[i]));
    }
    cout << endl;
    system("pause");
    return 0;
}
cs


결과 



틀린 곳이 있거나 더 좋은 의견이 있으시면 댓글 부탁드립니다.

'Language & API > C_기초' 카테고리의 다른 글

tolower(_In_ int _C) 사용법  (0) 2017.06.08
isxdigit(_In_ int _C) 사용법  (0) 2017.06.07
isupper(_In_ int _C) 사용법  (0) 2017.06.05
isspace(_In_ int _C) 사용법  (0) 2017.06.02
ispunct(_In_ int _C) 사용법  (0) 2017.06.01