Page 1 of 1
Requesting help with C++ homework please (CODE y u no work)
Posted: 22 Sep 2011, 07:29
by Lord_Leroy
Need to build the program using functions...
______________________________________________________________________________
Recieve the following error:
1>Lowest Score Drop.obj : error LNK2019: unresolved external symbol "void __cdecl getScores(float,int)" (?getScores@@YAXMH@Z) referenced in function _main
1>K:\...\Lowest Score Drop\Debug\Lowest Score Drop.exe : fatal error LNK1120: 1 unresolved externals
______________________________________________________________________________
#include<iostream>
using namespace std;
// Function getScores()
void getScores(float, int);
int main()
{
float scores[6], total;
for (int i = 0; i != 5; i++)
{
getScores(scores, i);
}
system("pause");
return 0;
}
void getScores(float scores[6], int i)
{
do
{
cout << "Enter Score between 1 and 10: ";
cin >> scores;
}
while(scores > 10 || scores < 0);
}
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 22 Sep 2011, 07:58
by Kriegsmarine
did you try not going for a career that involves endless streams of code that makes little sense in the hopes of it doing stuff?
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 22 Sep 2011, 08:47
by Haunwulf
Ask a professional coder, And not a bunch of hat obsessed gamers. That's your first clue to solving this homework assignment.
I don't understand this at all. Suprise me guys.
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 22 Sep 2011, 09:07
by Tampashrew
Put superglue in there somewhere. Superglue solves all the problems in the world.
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 22 Sep 2011, 11:36
by spleenter
Tampashrew wrote:Put superglue in there somewhere. Superglue solves all the problems in the world.
What superglue doesn't fix Duct tape does.
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 25 Sep 2011, 09:11
by Zarik
Hmmm to bad i don't take C++ until next semester :P
They made me take Visual Basic first D:
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 27 Sep 2011, 09:18
by Lord_Leroy
It's all good, I was able to get it done so a Mod can close this thread if they want.
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 27 Sep 2011, 09:45
by Tampashrew
You're welcome for my advice.
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 28 Sep 2011, 04:09
by Beetle
I had to take Java first
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 19 Jan 2012, 07:34
by Zarik'sBrother
Lord_Leroy wrote:Need to build the program using functions...
______________________________________________________________________________
Recieve the following error:
1>Lowest Score Drop.obj : error LNK2019: unresolved external symbol "void __cdecl getScores(float,int)" (?getScores@@YAXMH@Z) referenced in function _main
1>K:\...\Lowest Score Drop\Debug\Lowest Score Drop.exe : fatal error LNK1120: 1 unresolved externals
______________________________________________________________________________
#include<iostream>
using namespace std;
// Function getScores()
void getScores(float, int);
int main()
{
float scores[6], total;
for (int i = 0; i != 5; i++)
{
getScores(scores, i);
}
system("pause");
return 0;
}
void getScores(float scores[6], int i)
{
do
{
cout << "Enter Score between 1 and 10: ";
cin >> scores;
}
while(scores > 10 || scores < 0);
}
Other than the code not appearing to be in a working order why would you initialize your loop at 0 and set the end condition to when i does not equal five, your loop hits it's end condition immediately.
Zarik you havn't learned loops yet? All languages are basically the same bro, pay more attention!
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 19 Jan 2012, 07:40
by Celtic
28 Sep 2011, 05:09
u:
Posted: 5 minutes ago
Re: Requesting help with C++ homework please (CODE y u no wo
Posted: 19 Jan 2012, 07:43
by Zarik'sBrother
Haha celtic, thanks for pointing that out. I was looking at the forum and i guess this thread was right underneath one from december, otherwise I wouldn't have posted.. or perhaps I would have, just to pick on my little bro xD