C++代码异常

C++代码错误
#include<iostream>
struct car
{
char name[20];
int year;
};    //添加分号!!!!!!!!!!!!!! 
int main()
{
using namespace std;
cout<<"how many cars do you wish to catalog?";
int a;
cin>>a;
car * pt=new car[a];
int i =0;
for(i;i<a;i++)
{
cout<<"car #"<<i+1<<":"<<endl;
cout<<"please enter the make:";
getline(cin.name);
cout<<"please enter the year made:";
getline(cin.year);
}
cout<<"here is your collection:\n";
cout<<pt[i].name<<"  "<<pt[i].year;
delete[]pt;
return 0;
}
请问我在前面的结构已经有了name和year成员,为什么还会有下面的错误?
[Error] D:\My Documents\C-Free\Temp\未命名15.cpp:19: error: 'struct std::istream' has no member named 'name'
[Error] D:\My Documents\C-Free\Temp\未命名15.cpp:21: error: 'struct std::istream' has no member named 'year'

------解决思路----------------------
C++代码异常
你是不是想要这样的效果?
------解决思路----------------------
要加上public,少年

私有成员是默认的啊


------解决思路----------------------
你看报错,说的是:istream这个类没有name成员变量,不是说你的结构体没有这个成员变量。
istream是标准输入流,说白是一种类,cin是这个类定义的一个对象。
getline(cin.name)这是什么用法哦?!