怎么将键盘输入的数据输入到结构体中c++

不会用所学的知识,把键盘中的数据输入到结构体中

#include <iostream>
using namespace std;
struct student 
{
    int no;
    char name [6];
    int age;
    student *next;
};
int main()
{
int x;
cin>>x;
for(int si=0;si<x;si++)
{
    struct student si;
    cin>>si.no;
    cin>>si.name;
    cin>>si.age;
}
cout<<s3.no;
    return 0;
}

以上是简单测试了一下,程序报错,是不是要用什么函数啊
求解,我会的的知识可能不是太多,请多多指教,感谢!


#include <iostream>
using namespace std;
struct student
{
    int no;
    char name[6];
    int age;
    student* next;
};
int main()
{
        struct student si;
        cin >> si.no;
        cin >> si.name;
        cin >> si.age;
    cout << si.no;
    return 0;
}

我猜你是要输入多个信息。

int main()
{
    int x;
    cin >> x;
    struct student s[x];
    for (int i = 0; i < x; i++) //
    {
        cin >> s[i].no;
        cin >> s[i].name;
        cin >> s[i].age;
    }
    cout << s[3].no;
    return 0;
}