Hello
I have the following program. How can I pass the pointer of the struct to the function FindMax(...)
#include <stdio.h>
void FindMax(struct myStruct, int index);
void main()
{
int i;
struct Student
{
int Score;
char Name[10];
};
struct Student
list[5] =
{
{90,"Mike"},
{50,"Don"},
{89,"Tom"},
{70,"Jeff"},
{20,"Ron"}
};
printf("Name\t\tScore\n"
printf("----\t\t-----\n"
for (i = 0; i < 5; i++)
{
printf("%s", list.Name);
printf("\t\t%d\n", list.Score);
}
}
void FindMax(myStruct,index)
{
}
I have the following program. How can I pass the pointer of the struct to the function FindMax(...)
#include <stdio.h>
void FindMax(struct myStruct, int index);
void main()
{
int i;
struct Student
{
int Score;
char Name[10];
};
struct Student
list[5] =
{
{90,"Mike"},
{50,"Don"},
{89,"Tom"},
{70,"Jeff"},
{20,"Ron"}
};
printf("Name\t\tScore\n"
printf("----\t\t-----\n"
for (i = 0; i < 5; i++)
{
printf("%s", list.Name);
printf("\t\t%d\n", list.Score);
}
}
void FindMax(myStruct,index)
{
}