Friday, April 24, 2015

Adding object

Hi,

I'm a new MSDN user and I'm also a beginner C# programmer. I have the following C # code:

// I create an array of five students from a Student class
Student[] myStudents = new Student[5];

// I create a class object named Biology from the Course class
Course cs = new Course();
cs.courseName = "Biology";

Now I would like to know how to add my first student to the course object(cs) please. I tried myStudents[0].add(cs), myStudents[0].Add(cs), I tried everything but nothing ever worked, I do not know how to do that cause I'm a beginner C# programmer. I come here because I know it is the best place where I can find any C# solutions to my problems.

Thank you in advance for your valuable support.

No comments:

Post a Comment