i need some one check my solution in structure

Hello
I need help in understanding this question
And apply the solution properly
The mistakes that you should avoid the next time


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//Write a program that reads student's names followed by their ID and test scores. 
//student data should be stored in a struct variable of type studenttype which has
//3 members: name ,ID, and test score. Declare  array ITCS104students of size 7 of elements of type studenttype.

//add the following functions to your program:

//* a function to read all members of your array.

//* a function to print name and ID of the student with the highest test score.

# include <iostream>
# include <string>
using namespace std;
struct studentType
{
	string name;
	long ID;
	int testscore;
};


void Readallmembers(studentType &arr)
{
	cout << "Enter name ID and test score =\n";
	cin >> arr.name >> arr.ID >> arr.testscore >> endl;
}


void Printallmembers(studentType &arr)
{
	cout << "Name= " << arr.name << endl;
	cout << "ID=" << arr.ID <<endl;
	cout << "Test Score=" << arr.testscore <<endl;
}

int main()
{
	studentType ITCS104students[5];
	for(int i=0 ; i<5 ; i++)
		Readallmembers(ITCS104students[i]);
	
	for(int i=0 ; i<5 ; i++)
		Printallmembers(ITCS104students[i]);
	
	return 0;
}















no one can help me with that ?
Explain what exactly you need help with, we cant read your mind. Once you give us a subject to help you on we'll work from there.
i put every thing up there the question is there and my solve is there , there is syntax error i want some one to check it to me and fix it >> i think its clear my friend
No, it wasn't clear. Your OP did not state that you were getting a syntax error.
How were we supposed to know that was your problem?
You could have posted the error text along with your code.

Line 25: You can't do a cin to endl. endl is an ostream manipulator.
closed account (owbkoG1T)
http://www.cplusplus.com/articles/Ny86b7Xj/

Next time please state what you are trying to do, what you are expecting to happen, what is happening and if applicable, exact error messages (not reworded; copy and paste them).

The users here aren't always going to look through every line of your code to find what is wrong, they are expecting something to start off with. Error messages are really helpful with that.
Topic archived. No new replies allowed.