array with both string & float columns
-
Hello all. I want to define an array in c win32 console. First column should be name & family of students and other columns should be grades of them. NOW HELP ME : How can I have this array with first string column and other columns in float. Thanks in advance.
-
Hello all. I want to define an array in c win32 console. First column should be name & family of students and other columns should be grades of them. NOW HELP ME : How can I have this array with first string column and other columns in float. Thanks in advance.
Create a structure with name and grades as members.
struct _tagStudent
{
char Name[256];
float Math;
float Science;
};Now you can create an array of Students.
struct _tagStudent Student[100];
You can access the members as follows -Student[0].Name;
Student[0].Math;Student[25].Name;
Student[25].Science;«_Superman_»
I love work. It gives me something to do between weekends.