[c#] Array of structs example

i am bit new to structs in c#..

My question says:

Write a console application that receives the following information for a set of students: studentid, studentname, coursename, date-of-birth.. The application should also be able to display the information being entered.. Implement this using structs..

I have come up till this-->

struct student
{
    public int s_id;
    public String s_name, c_name, dob;
}
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Please enter StudentId, StudentName, CourseName, Date-Of-Birth");
        s_id = Console.ReadLine();
        s_name = Console.ReadLine();
        c_name = Console.ReadLine();
        s_dob = Console.ReadLine();
        student[] arr = new student[4];
    }
}

Please help me after this..

This question is related to c# arrays struct

The answer is


Given an instance of the struct, you set the values.

    student thisStudent;
    Console.WriteLine("Please enter StudentId, StudentName, CourseName, Date-Of-Birth");
    thisStudent.s_id = int.Parse(Console.ReadLine());
    thisStudent.s_name = Console.ReadLine();
    thisStudent.c_name = Console.ReadLine();
    thisStudent.s_dob = Console.ReadLine();

Note this code is incredibly fragile, since we aren't checking the input from the user at all. And you aren't clear to the user that you expect each data point to be entered on a separate line.