C++ Cockblockage.. - Page 2
Blogs > Dave[9] |
Always
United States376 Posts
| ||
Disregard
China10252 Posts
edit: Not sure but Java is very sensitive with everything, but seems you randomly capitalized "student" in some of the lines that arent related to the name of the program. I could be wrong, only beginner Java here. :/ | ||
Dave[9]
United States2365 Posts
Love you guys | ||
Alphonsse
United States518 Posts
I would advise changing the s_sort function to accept your array of Student_Statistic structures, instead of a bunch of arrays that represent the fields in those structures. This way, after all of the students have been read in from the file, you can then pass s_sort your array of students, and it will come back sorted. so instead of: void s_sort( int x[],string y[],double a[],double b[], int n); you'd have something like: void s_sort(Student_Statistics[] students); Inside the function, you'd have to change x[whatever] to students[whatever].student_id (assuming the x array was representing student_id). | ||
HeavOnEarth
United States7087 Posts
| ||
JeeJee
Canada5652 Posts
On December 10 2009 14:17 Disregard wrote: Wow... Java is almost exactly the same. I never noticed. edit: Not sure but Java is very sensitive with everything, but seems you randomly capitalized "student" in some of the lines that arent related to the name of the program. I could be wrong, only beginner Java here. :/ java's pretty similar just a lot more fun to program in god i hate C so much programming in C is like visiting a dentist who hates you >.< btw it seems ur current problem is that you're passing .studentID which is an int but your method's expecting an array of ints because that's how you declared it (although in your actual method you're expecting an array of doubles) stay consistent ;o also, better variable names never hurt anyone =) arbitrary letters are almost never the way to go aside from for loops or something, and even then .. :p | ||
Cambium
United States16368 Posts
This is what you are passing in
All but your last input parameters are incorrectly typed. | ||
haduken
Australia8267 Posts
don't write your code like that. it's messy and when shits go wrong you will kill yourself. writing any kinda of algorithm in C/C++ is a pain but type checking is very important, you need to get yourself around it. | ||
yh8c4
108 Posts
| ||
DeathSpank
United States1029 Posts
On December 15 2009 17:20 yh8c4 wrote: you can save yourself some headaches if you use container classes like std::vector<> instead of the built-in [] arrays. a crutch wont teach you how to walk. | ||
| ||