분류 > C++
class Data
{
int nYear;
int nMonth;
int nDay;
}
int main( void )
{
Data cData;
int* ptr;
ptr = (int*)&cData;
cout << "Year = " << *ptr << ", Month = " << *(ptr+1) << ", Day = " << *(ptr+2) << endl;
return 0;
}
댓글 없음:
댓글 쓰기