no because we don't know what students is, what grade1 is, what grade2 is, etc. Thats why I said variable declartion
no because we don't know what students is, what grade1 is, what grade2 is, etc. Thats why I said variable declartion
sorry misunderstood.. Here you go..
Code:struct grades /*Structure to put the text into.*/ { char students[30]; int grade1; int grade2; int grade3; }; struct grades students[30], grade1, grade2, grade3;
Ok so right now students is an array of struct grades. grade1, grade2, grade3 are all struct grades.
So when you callall the parameters are grades not an array of char, an int, an int, an int.Code:readfile(students[30], grade1, grade2,grade3);
Oh, so it's like I said, you aren't passing the arguments correctly. Do you see what you're doing here? You should, because I already mentioned it to you once.
Let's use the Way-Back-Machine(TM) and see exactly what it was I wrote...Code:struct grades students[30], grade1, grade2, grade3;
The only thing different is that you got rid of the pointer. I don't think you really understand what a structure is.Originally Posted by quzah
Quzah.
Hope is the first step on the road to disappointment.
I am not passing the structure though.. I am only passing the things in the structure.. such as the students, grade1, grade2, grade3.... Then what do I have to do to get rid of the errors and call the function properly... I am a little confused here...
No you aren't. If you did you would have something likeCode:somevar.grade1
Last edited by Thantos; 02-06-2005 at 06:41 PM.
So how do I correct it or what can I do to fix it.. Your statement was a little vague for me... I am still new at this so I am a little slow... sorry....
Well I'd suggest you read up on how to use a structure.
http://faq.cprogramming.com/cgi-bin/...&id=1073086407
here is another one to help you better understand.
Warning: Opinions subject to change without notice
The C Library Reference Guide
Understand the fundamentals
Then have some more fun