Sf

Mar 23, 2013 at 7:42pm
asdf
Last edited on Mar 27, 2013 at 8:21pm
Mar 23, 2013 at 8:16pm
classes school []; is illegal. You must specify a size (that is a compile-time constant) for the array. You may want to disable the compiler extension that allows it.

In readSchool (school[5]); school[5] is an element of the array. Since you didn't specify a size for the array and your array has no elements, 5 is an invalid index into the array.

The proper way to call readSchool (after supplying a size on line 23) is: readSchool(school).
Mar 23, 2013 at 8:16pm
Change line 29 readSchool (school[5]); to readSchool (school); and change line 23 classes school []; to classes school [5]; school should be a local variable in main, but thats up to you. Note this code won't compile until you define your readClasses function
Mar 23, 2013 at 8:59pm
yup that did it. thanks!!
Mar 25, 2013 at 2:42pm
Just to clarify things - your error message was telling you that you were trying to pass an object of type classes (school[5]) into a function expecting an argument of type classes* - that is a pointer to classes. The two are different types.

Topic archived. No new replies allowed.