#include <iostream>
struct antarctica_years_end
{
int year;
};
int main ()
{
using namespace std;
antarctica_years_end s01, s02, s03;
s01.year = 1998;
antarctica_years_end * pa = &s02;
pa->year = 1999;
antarctica_years_end trio[3];
trio[0].year = 2003;
cout << trio->year << endl;
const antarctica_years_end * arp[3] = {&s01, &s02, &s03};
cout << arp[1]->year << endl;
const antarctica_years_end ** ppa = arp;
auto ppb = arp;
cout << (*ppa)->year << endl;
cout << (*(ppa+1))->year << endl;
return 0;
}
const 안 쓰면 컴파일이 안됨;;
왜지
arp가 const니까 - dc App
니가 말한 대로라면 arp를 선언할 땐 const를 사용 하지 않아도 컴파일이 되야 하는 거 아니야 ? 안 되는데?>
나는 const 빼도 되는데 에러메세지 머임 - dc App