typedef
// *****************
// typedef 예약어 사용 예
#include <iostream>
typedef unsigned short int USHORT; // typedef로 정의된다.
int main()
{
using std::cout;
using std::endl;
USHORT Width = 5;
USHORT Length;
Length = 10;
USHORT Area = Width * Length;
cout << "Width : " << Width << endl;
cout << "Length : " << Length << endl;
cout << "Area : " << Area << endl;
return 0;
}
결과
Width : 5
Length : 10
Area : 50
Width : 5
Length : 10
Area : 50
'Programming > C / C++' 카테고리의 다른 글
단일체 (Singleton) 코드 (2) | 2008.07.05 |
---|---|
const 키워드의 의미 (0) | 2008.05.28 |
동적할당을 통한 행열의 곱셈, 역행열, 전치행열 구하기 (0) | 2007.11.23 |
ASSERT, VERIFY, TRACE (0) | 2007.01.31 |
[C++] typedef (0) | 2006.11.02 |