저는 C++빌더6에서 이상 없이 잘 컴파일되는데요?
소스에는 이상이 없고요, 뭔가 설치나 설정에 문제가 있는듯합니다.
참고로,
#include <cctype>
을 써서 C 함수인 tolower와 toupper를 쓰는 대신에,
C++ 헤더인
#include <locale>
를 써서 C++ 함수 tolower와 toupper를 써보세요.
물론 이상없이 컴파일되었습니다.
참고로 transform 알고리듬을 사용하지 않고,
<locale> 헤더파일 만을 사용하여 대소문자를 변환하는 방법도 있습니다.
다음 코드를 참고하세요.
//---------------------------------------------------------------------------
#include <locale>
#include <iostream>
#include <string>
//---------------------------------------------------------------------------
using namespace std;
#pragma argsused
int main(int argc, char* argv[])
{
string s("The zip code of 38108");
cout << "original : " << s << endl;
locale L; // 예를 들어, 독일어라면 locale L("de");
const ctype<char>& ct = use_facet<ctype<char> >(L);
ct.tolower( s.begin(), s.end() );
cout << "lowered : " << s << endl;
ct.toupper( s.begin(), s.end() );
cout << "uppered : " << s << endl;
return 0;
}
//---------------------------------------------------------------------------
좀 더 자세한 설명은 다음 글을 참고하세요.
http://www.borlandforum.com/impboard/impboard.dll?action=read&db=cpp_tip&no=16