• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:58
CET 16:58
KST 00:58
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy7ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool43Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Weekly Cups (March 16-22): herO doubles, Cure surprises Weekly Cups (August 25-31): Clem's Last Straw? Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2)
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
mca64Launcher - New Version with StarCraft: Remast BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion Soulkey's decision to leave C9 JaeDong's form before ASL
Tourneys
[ASL21] Ro24 Group B 2026 Changsha Offline Cup [ASL21] Ro24 Group A ASL Season 21 LIVESTREAM with English Commentary
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread European Politico-economics QA Mega-thread YouTube Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3627 users

C++ Cockblockage..

Blogs > Dave[9]
Post a Reply
Normal
Dave[9]
Profile Blog Joined October 2003
United States2365 Posts
Last Edited: 2009-12-10 05:35:10
December 10 2009 02:33 GMT
#1
Editted, I suck at sorting anyone care to help? I get an error that tells me I can't convert parameter 1 of 's_sort' from 'int' to 'int []'

If anything if you can help, point out what I'm doing wrong
+ Show Spoiler +

 
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

struct Student_Statistics
{
int student_id;
string name;
double quiz1, quiz2, quiz3, quiz4, quiz5;
double midterm1, midterm2, final;
double average;
char letter_grade;
};

void s_sort( int x[],string y[],double a[],double b[], int n);
double find_lowest(Student_Statistics student);
int main()
{
Student_Statistics Student[30];
ifstream in_file;
char grade_file[80];
int i = 0;
int j;
int k;
double all_averagesA = 0;
double all_averages;

cout << "Enter an input file: ";
cin >> grade_file;
in_file.open(grade_file);


cout << "---------------------------------------------------" << endl;
cout << " Individual Course Report" << endl;
cout << "---------------------------------------------------" << endl;

while(!in_file.eof())
{
in_file >> Student[i].student_id >> Student[i].name
>> Student[i].quiz1 >> Student[i].quiz2 >> Student[i].quiz3 >> Student[i].quiz4 >> Student[i].quiz5
>> Student[i].midterm1 >> Student[i].midterm2 >> Student[i].final;

cout.setf(ios::showpoint);
cout.setf(ios::fixed);
cout.precision(2);
if(find_lowest(Student[i]) >= 90)
{
Student[i].letter_grade = 'A';
}
if((find_lowest(Student[i]) < 90) && (find_lowest(Student[i]) >= 80))
{
Student[i].letter_grade = 'B';
}
if((find_lowest(Student[i]) < 80) && (find_lowest(Student[i]) >= 70))
{
Student[i].letter_grade = 'C';
}
if((find_lowest(Student[i]) < 70) && (find_lowest(Student[i]) >= 60))
{
Student[i].letter_grade = 'D';
}
if(find_lowest(Student[i]) < 60)
{
Student[i].letter_grade = 'F';
}
s_sort(Student[i].student_id, Student[i].name, find_lowest(Student[i]), Student[i].letter_grade, i);
cout << Student[i].student_id << ' ' << Student[i].name << " - " << find_lowest(Student[i]) <<" (" << Student[i].letter_grade << ')' << endl;
i++;
}
cout << endl;
cout << "---------------------------------------------------" << endl;
cout << " Statistics" << endl;
cout << "---------------------------------------------------" << endl;
cout << "Number of Students: " << i << endl;

for(j=0;j<i;j++)
{
all_averagesA+=find_lowest(Student[j]);
all_averages=all_averagesA/i;

}
cout.setf(ios::showpoint);
cout.setf(ios::fixed);
cout.precision(1);
cout << "Average of all students: " << all_averages << endl;
cout << "Grade Distribution (histrogram)" << endl;

cout << " A: ";
for(k=0;k<i;k++)
{
if(Student[k].letter_grade == 'A')
{
cout << '*';
}
}
cout << endl;

cout << " B: ";
for(k=0;k<i;k++)
{
if(Student[k].letter_grade == 'B')
{
cout << '*';
}
}
cout << endl;

cout << " C: ";
for(k=0;k<i;k++)
{
if(Student[k].letter_grade == 'D')
{
cout << '*';
}
}
cout << endl;

cout << " D: ";
for(k=0;k<i;k++)
{
if(Student[k].letter_grade == 'D')
{
cout << '*';
}
}
cout << endl;

cout << " F: ";
for(k=0;k<i;k++)
{
if(Student[k].letter_grade == 'F')
{
cout << '*';
}
}
cout << endl;

return 0;
}


double find_lowest(Student_Statistics student)
{
if((student.quiz1 < student.quiz2) && (student.quiz1 < student.quiz3) && (student.quiz1 < student.quiz4) && (student.quiz1 < student.quiz5))
{
student.average = ((student.quiz2*(.2) + student.quiz3*(.2) + student.quiz4*(.2) + student.quiz5*(.2) + student.midterm1*(.4) + student.midterm2*(.4) + student.final*(.4))/128)*100;
}
else if((student.quiz2 < student.quiz1) && (student.quiz2 < student.quiz3) && (student.quiz2 < student.quiz4) && (student.quiz2 < student.quiz5))
{
student.average = ((student.quiz1*(.2) + student.quiz3*(.2) + student.quiz4*(.2) + student.quiz5*(.2) + student.midterm1*(.4) + student.midterm2*(.4) + student.final*(.4))/128)*100;
}
else if((student.quiz3 < student.quiz1) && (student.quiz3 < student.quiz2) && (student.quiz3 < student.quiz4) && (student.quiz3 < student.quiz5))
{
student.average = ((student.quiz1*(.2) + student.quiz2*(.2) + student.quiz4*(.2) + student.quiz5*(.2) + student.midterm1*(.4) + student.midterm2*(.4) + student.final*(.4))/128)*100;
}
else if((student.quiz4 < student.quiz1) && (student.quiz4 < student.quiz2) && (student.quiz4 < student.quiz3) && (student.quiz4 < student.quiz5))
{
student.average = ((student.quiz1*(.2) + student.quiz2*(.2) + student.quiz3*(.2) + student.quiz5*(.2) + student.midterm1*(.4) + student.midterm2*(.4) + student.final*(.4))/128)*100;
}
else if((student.quiz5 < student.quiz1) && (student.quiz5 < student.quiz2) && (student.quiz5 < student.quiz3) && (student.quiz5 < student.quiz4))
{
student.average = ((student.quiz1*(.2) + student.quiz2*(.2) + student.quiz3*(.2) + student.quiz4*(.2) + student.midterm1*(.4) + student.midterm2*(.4) + student.final*(.4))/128)*100;
}

return student.average;
}
void s_sort(double x[],string y[],double a[],double b[], int n)
{
int m; // keep the index of current smallest value
double hold;
string hold2;
double hold3;
double hold4;

for (int k=0; k<=n-2; k++)
{
m = k;
for (int j=k+1; j <= n-1; j++)
{
if (x[j] > x[m])
m = j;
}

hold = x[m];
hold2 = y[m];
hold3 = a[m];
hold4 = b[m];
x[m] = x[k];
y[m] = y[k];
a[m] = a[k];
b[m] = b[k];
x[k] = hold;
y[k] = hold2;
a[k] = hold3;
b[k] = hold4;

}

return;
}








http://www.teamliquid.net/forum/viewmessage.php?topic_id=104154&currentpage=316#6317
huameng
Profile Blog Joined April 2007
United States1133 Posts
December 10 2009 02:40 GMT
#2
Why is find_lowest declared as void, even though it returns something?

And why does it have a parameter, even though when you call it, you pass nothing?

skating
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
Last Edited: 2009-12-10 02:47:08
December 10 2009 02:46 GMT
#3
In addition to what huameng said you also are using variable 'i' inside of find_lowest, but 'i' isn't in that scope.
twitter: @terrancem
ghostWriter
Profile Blog Joined January 2009
United States3302 Posts
December 10 2009 02:46 GMT
#4
Man, there's nothing more annoying than trying to find out why your code won't compile.
Sullifam
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
December 10 2009 02:47 GMT
#5
Oh also, looks like you have some capitalized Student[i] when you probably mean lowercase student[i] near the end of find_lowest
twitter: @terrancem
Dave[9]
Profile Blog Joined October 2003
United States2365 Posts
December 10 2009 02:50 GMT
#6
omggggggggg so much to fix, lol...
http://www.teamliquid.net/forum/viewmessage.php?topic_id=104154&currentpage=316#6317
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
Last Edited: 2009-12-10 02:53:05
December 10 2009 02:50 GMT
#7
From the code it looks like find_lowest should take in a single 'Student_Statistics' variable.
so declared as such
double find_lowest(Student_Statistics student)

so you would call it like so;
find_lowest(Student[i])

then inside of find_lowest get rid of all the references to 'student[i]' and just use 'student' instead
twitter: @terrancem
Phyre
Profile Blog Joined December 2006
United States1288 Posts
December 10 2009 02:50 GMT
#8
You seem to have all kinds of scope problems. It's like you're treating every variable like it was global or something, like "i" being accessed in find_lowest(). As has already been mentioned you designed find_lowest() to take a parameter but you give it no parameters when you use it. Lots of problems here.
"Oh no, I got you with your pants... on your face... That's not how you wear pants." - Nintu, catching 1 hatch lurks.
Dave[9]
Profile Blog Joined October 2003
United States2365 Posts
December 10 2009 02:53 GMT
#9
looks like the main thing my compiler is saying is:

'student' is an undeclared identifier -- i dont even know where to begin to fix that..
'find lowest' illegal use of the type 'void


also, updated the code.
http://www.teamliquid.net/forum/viewmessage.php?topic_id=104154&currentpage=316#6317
Kwidowmaker
Profile Blog Joined October 2007
Canada978 Posts
December 10 2009 02:54 GMT
#10
just rewrite. It takes like 1/12 the time it took to write originally and it ends up being better code
Kk.
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
December 10 2009 02:55 GMT
#11
On December 10 2009 11:53 Dave[9] wrote:
looks like the main thing my compiler is saying is:

'student' is an undeclared identifier -- i dont even know where to begin to fix that..
'find lowest' illegal use of the type 'void


also, updated the code.

You are using something that returns void in your cout. So cout is looking for something to print and it finds a function that returns void and it's confused.

Take a look at my suggestions and see if they help.
twitter: @terrancem
Heyoka
Profile Blog Joined March 2008
Katowice25012 Posts
December 10 2009 02:56 GMT
#12
this would be the easiest thing in sas you should make that part of your program imo
@RealHeyoka | ESL / DreamHack StarCraft Lead
Phyre
Profile Blog Joined December 2006
United States1288 Posts
December 10 2009 02:57 GMT
#13
On December 10 2009 11:53 Dave[9] wrote:
looks like the main thing my compiler is saying is:

'student' is an undeclared identifier -- i dont even know where to begin to fix that..
'find lowest' illegal use of the type 'void


also, updated the code.

When you declare the function of type "void" you are saying that the function will return nothing. Your function returns Student.average which is a variable of type "double".
"Oh no, I got you with your pants... on your face... That's not how you wear pants." - Nintu, catching 1 hatch lurks.
Eti307
Profile Blog Joined March 2004
Canada3442 Posts
Last Edited: 2009-12-10 02:58:08
December 10 2009 02:57 GMT
#14
this is messy lol

try something like this, only minor changes but now it's compiling. I can't test it since I don't have your input files but you can take it form here lol:
+ Show Spoiler +

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

struct Student_Statistics
{
int student_id;
string name;
double quiz1, quiz2, quiz3, quiz4, quiz5;
double midterm1, midterm2, final;
double average;
};

double find_lowest(Student_Statistics student);

int main()
{
Student_Statistics Student[30];
ifstream in_file;
char grade_file[80];
int i = 0;

cout << "Enter an input file: ";
cin >> grade_file;
in_file.open(grade_file);


cout << "---------------------------------------------------" << endl;
cout << " Individual Course Report" << endl;
cout << "---------------------------------------------------" << endl;

while(!in_file.eof())
{
in_file >> Student[i].student_id >> Student[i].name
>> Student[i].quiz1 >> Student[i].quiz2 >> Student[i].quiz3 >> Student[i].quiz4 >> Student[i].quiz5
>> Student[i].midterm1 >> Student[i].midterm2 >> Student[i].final;


cout << Student[i].student_id << Student[i].name << find_lowest(Student[i]) << endl;
i++;
}
return 0;
}


double find_lowest(Student_Statistics student)
{
if((student.quiz1 < student.quiz2) && (student.quiz1 < student.quiz3) && (student.quiz1 < student.quiz4) && (student.quiz1 < student.quiz5))
{
student.average = (student.quiz2 + student.quiz3 + student.quiz4 + student.quiz5)/4;
}
else if((student.quiz2 < student.quiz1) && (student.quiz2 < student.quiz3) && (student.quiz2 < student.quiz4) && (student.quiz2 < student.quiz5))
{
student.average = (student.quiz1 + student.quiz3 + student.quiz4 + student.quiz5)/4;
}
else if((student.quiz3 < student.quiz1) && (student.quiz3 < student.quiz2) && (student.quiz3 < student.quiz4) && (student.quiz3 < student.quiz5))
{
student.average = (student.quiz1 + student.quiz2 + student.quiz4 + student.quiz5)/4;
}
else if((student.quiz4 < student.quiz1) && (student.quiz4 < student.quiz2) && (student.quiz4 < student.quiz3) && (student.quiz4 < student.quiz5))
{
student.average = (student.quiz1 + student.quiz2 + student.quiz3 + student.quiz5)/4;
}
else if((student.quiz5 < student.quiz1) && (student.quiz5 < student.quiz2) && (student.quiz5 < student.quiz3) && (student.quiz5 < student.quiz4))
{
student.average = (student.quiz1 + student.quiz2 + student.quiz3 + student.quiz4)/4;
}

return student.average;
}
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
December 10 2009 03:01 GMT
#15
On December 10 2009 11:57 Eti307 wrote:
this is messy lol

try something like this, only minor changes but now it's compiling. I can't test it since I don't have your input files but you can take it form here lol:
+ Show Spoiler +

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

struct Student_Statistics
{
int student_id;
string name;
double quiz1, quiz2, quiz3, quiz4, quiz5;
double midterm1, midterm2, final;
double average;
};

double find_lowest(Student_Statistics student);

int main()
{
Student_Statistics Student[30];
ifstream in_file;
char grade_file[80];
int i = 0;

cout << "Enter an input file: ";
cin >> grade_file;
in_file.open(grade_file);


cout << "---------------------------------------------------" << endl;
cout << " Individual Course Report" << endl;
cout << "---------------------------------------------------" << endl;

while(!in_file.eof())
{
in_file >> Student[i].student_id >> Student[i].name
>> Student[i].quiz1 >> Student[i].quiz2 >> Student[i].quiz3 >> Student[i].quiz4 >> Student[i].quiz5
>> Student[i].midterm1 >> Student[i].midterm2 >> Student[i].final;


cout << Student[i].student_id << Student[i].name << find_lowest(Student[i] << endl;
i++;
}
return 0;
}


double find_lowest(Student_Statistics student)
{
if((student.quiz1 < student.quiz2) && (student.quiz1 < student.quiz3) && (student.quiz1 < student.quiz4) && (student.quiz1 < student.quiz5))
{
student.average = (student.quiz2 + student.quiz3 + student.quiz4 + student.quiz5)/4;
}
else if((student.quiz2 < student.quiz1) && (student.quiz2 < student.quiz3) && (student.quiz2 < student.quiz4) && (student.quiz2 < student.quiz5))
{
student.average = (student.quiz1 + student.quiz3 + student.quiz4 + student.quiz5)/4;
}
else if((student.quiz3 < student.quiz1) && (student.quiz3 < student.quiz2) && (student.quiz3 < student.quiz4) && (student.quiz3 < student.quiz5))
{
student.average = (student.quiz1 + student.quiz2 + student.quiz4 + student.quiz5)/4;
}
else if((student.quiz4 < student.quiz1) && (student.quiz4 < student.quiz2) && (student.quiz4 < student.quiz3) && (student.quiz4 < student.quiz5))
{
student.average = (student.quiz1 + student.quiz2 + student.quiz3 + student.quiz5)/4;
}
else if((student.quiz5 < student.quiz1) && (student.quiz5 < student.quiz2) && (student.quiz5 < student.quiz3) && (student.quiz5 < student.quiz4))
{
student.average = (student.quiz1 + student.quiz2 + student.quiz3 + student.quiz4)/4;
}

return student.average;
}


Nice. That's basically exactly what I was suggesting. I was just working on putting it into pastebin but now that you have it, I don't need to.
twitter: @terrancem
Dave[9]
Profile Blog Joined October 2003
United States2365 Posts
December 10 2009 03:02 GMT
#16
Alright, you guys gave me enough hints that I arrived at Eti's code. thank you guys sooooooo much.

http://www.teamliquid.net/forum/viewmessage.php?topic_id=104154&currentpage=316#6317
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
December 10 2009 03:02 GMT
#17
dodeedo
"come korea next time... FXO house... 10 korean, 10 korean"
Eti307
Profile Blog Joined March 2004
Canada3442 Posts
December 10 2009 03:03 GMT
#18
I didn't want to completely change his code so I just modified it so it would work.

Just so you know Dave, there are way better ways to do this. But you're just starting from what I see.
We've all been there
Ironson
Profile Joined February 2008
20 Posts
December 10 2009 03:51 GMT
#19
In addition to the above comments, the find_lowest is broken:
1) The algorithm for finding the average of the four highest scores is wrong. Suppose I gave it a student with scores {1., 1., 2., 3., 4.}, where index i corresponds to student.quiz$i. You're likely to get a garbage response because the "average" field isn't explicitly initialized.
2) Assigning to student.average doesn't do anything, and is rather misleading (it's not incorrect for this program, but should you extend it in the future...). Either pass in student via reference/pointer, or create a local double variable to hold the result.
Chuiu
Profile Blog Joined June 2003
3470 Posts
December 10 2009 03:56 GMT
#20
If you're going to be programming and making spelling mistakes, make sure you learn how to use find/replace or regex, it fixes little problems like that very fast.
♞
Always
Profile Blog Joined March 2009
United States376 Posts
December 10 2009 04:09 GMT
#21
lol this is awesome. i haven't done anything with C++ since 9th grade, but i like how everyone comes in to help
"Do unto others 20% better than you would expect them to do unto you, to correct for subjective error." - Linus Pauling
Disregard
Profile Blog Joined March 2007
China10252 Posts
Last Edited: 2009-12-10 05:19:37
December 10 2009 05:17 GMT
#22
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. :/
"If I had to take a drug in order to be free, I'm screwed. Freedom exists in the mind, otherwise it doesn't exist."
Dave[9]
Profile Blog Joined October 2003
United States2365 Posts
December 10 2009 05:36 GMT
#23
okay, I got way further in my code, and now I'm stuck on the sorting part of it, can more of you have a look?


Love you guys
http://www.teamliquid.net/forum/viewmessage.php?topic_id=104154&currentpage=316#6317
Alphonsse
Profile Blog Joined March 2009
United States518 Posts
December 10 2009 06:26 GMT
#24
The reason it doesn't work right now is you're passing s_sort a single students grades, when the function is expecting arrays containing all of the students grades. Also, you're calling s_sort every time you're reading in an individual students info, when it should only need to be called once.

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
Profile Blog Joined March 2008
United States7087 Posts
December 14 2009 21:08 GMT
#25
doooodeedoooo
"come korea next time... FXO house... 10 korean, 10 korean"
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
Last Edited: 2009-12-14 21:21:19
December 14 2009 21:12 GMT
#26
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
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
Cambium
Profile Blog Joined June 2004
United States16368 Posts
December 15 2009 00:35 GMT
#27
This is your definition of s_sort


void s_sort( int x[],string y[],double a[],double b[], int n);


This is what you are passing in

s_sort(Student[i].student_id, Student[i].name, find_lowest(Student[i]), Student[i].letter_grade, i);


All but your last input parameters are incorrectly typed.
When you want something, all the universe conspires in helping you to achieve it.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
December 15 2009 07:20 GMT
#28
simple case of mismatching function arguments.

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.
Rillanon.au
yh8c4
Profile Blog Joined July 2009
108 Posts
December 15 2009 08:20 GMT
#29
you can save yourself some headaches if you use container classes like std::vector<> instead of the built-in [] arrays.
DeathSpank
Profile Blog Joined February 2009
United States1029 Posts
December 15 2009 12:07 GMT
#30
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.
yes.
Normal
Please log in or register to reply.
Live Events Refresh
Next event in 8h 2m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko475
LamboSC2 303
Trikslyr43
Rex 34
Codebar 13
StarCraft: Brood War
Britney 28303
Calm 7840
Bisu 2770
Shuttle 1213
Larva 657
BeSt 536
Mini 415
Rush 383
firebathero 375
Stork 374
[ Show more ]
Soma 367
Snow 316
ZerO 314
Light 292
EffOrt 286
ggaemo 229
Leta 171
actioN 171
PianO 99
Zeus 86
Sea.KH 77
Mind 73
Sharp 71
Backho 69
HiyA 45
[sc1f]eonzerg 43
Free 42
Barracks 37
sorry 34
Hm[arnc] 26
Movie 22
Terrorterran 19
IntoTheRainbow 17
soO 17
Shinee 15
Sacsri 12
ajuk12(nOOB) 8
ivOry 6
Dota 2
Gorgc7087
Counter-Strike
fl0m1028
edward90
oskar89
adren_tv49
Heroes of the Storm
MindelVK20
Other Games
singsing2054
hiko774
B2W.Neo772
FrodaN665
DeMusliM290
Hui .174
crisheroes150
ArmadaUGS111
Liquid`VortiX109
QueenE108
Sick103
ZerO(Twitch)17
Organizations
Dota 2
PGL Dota 2 - Main Stream45
StarCraft: Brood War
Kim Chul Min (afreeca) 8
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• poizon28 44
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3473
• TFBlade861
• Shiphtur29
Upcoming Events
PiGosaur Cup
8h 2m
Replay Cast
17h 2m
Afreeca Starleague
18h 2m
hero vs YSC
Larva vs Shine
Kung Fu Cup
19h 2m
Replay Cast
1d 8h
KCM Race Survival
1d 17h
The PondCast
1d 18h
WardiTV Team League
1d 20h
OSC
1d 20h
Replay Cast
2 days
[ Show More ]
WardiTV Team League
2 days
RSL Revival
3 days
Cure vs Zoun
herO vs Rogue
WardiTV Team League
3 days
Platinum Heroes Events
3 days
BSL
4 days
RSL Revival
4 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
4 days
BSL
5 days
Replay Cast
5 days
Replay Cast
5 days
Afreeca Starleague
5 days
Light vs Calm
Royal vs Mind
Wardi Open
5 days
Monday Night Weeklies
6 days
OSC
6 days
Sparkling Tuna Cup
6 days
Afreeca Starleague
6 days
Rush vs PianO
Flash vs Speed
Liquipedia Results

Completed

Proleague 2026-03-23
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.