std::toupper
cppreference.com
<tbody>
</tbody>
| <cctype> 에 정의되어 있음.
|
||
int toupper( int ch ); |
||
인자로 전달받은 문자를 현재 C 로케일 설정의 변환 규칙에 따라 적절한 대문자로 변환합니다.
Parameters
| ch | - | 변환할 문자 |
Return value
변환된 문자 혹은 현재 C 로케일에서 정의하는 대문자 버전이 없으면 ch을 리턴합니다.
Example
코드 실행
#include <iostream>
#include <cctype>
#include <clocale>
int main()
{
char c = '\xb8'; // ISO-8859-15 의 문자 ž
// ISO-8859-1 에서는 (cedilla)
std::setlocale(LC_ALL, "en_US.iso88591");
std::cout << std::hex << std::showbase;
std::cout << "in iso8859-1, toupper('0xb8') gives " << std::toupper(c) << '\n';
std::setlocale(LC_ALL, "en_US.iso885915");
std::cout << "in iso8859-15, toupper('0xb8') gives " << std::toupper(c) << '\n';
}
Output:
in iso8859-1, toupper('0xb8') gives 0xb8
in iso8859-15, toupper('0xb8') gives 0xb4
See also
| converts a character to lowercase (function) | |
| converts a character to uppercase using the ctype facet of a locale (function template) | |
| converts a wide character to uppercase (function) | |
C documentation for toupper
| |