hey there im starting my program over so im trying to just bulid the first option then add the rest of the ptions once i have this working but im getting a fatal error... everything looks good to me but i suck at it lol
finalproject2.obj : error LNK2019: unresolved external symbol "int __cdecl hw1(void)" (?hw1@@YAHXZ) referenced in function _main
1>C:\Users\Rachael Ann\Documents\Visual Studio 2010\Projects\finalproject\Debug\finalproject.exe : fatal error LNK1120: 1 unresolved externals
Did you define int hw1() someplace? You call it a couple times, but there is nothing in your code, that I can see, that goes beyond that.
<edit>
Is line 62 supposed to start the definition, and what follows the body of the function? If so, you need to move it outside of main() and surround the body with curly brackets instead of ending it with a semicolon.
ok so i did that but now it will compile and i can not get it to advance to hw1 .... it stays there. also how do i get it to return to the main menu when i am done
Your indentation is really bad which is why you aren't seeing what's wrong.
first thing, line 63:
void hw1(); // <-- don't put a semi-colon there if this is your function implementaion start
then:
- lines 94 and 95 have no semi-colons at the end of the lines and they need them.
- line 97, why the 2 closing brace??
- you are returning a value from your function, but you've declared it void i.e. not to return anything from that function.
ok i fixed most of it on the second post im changing the void to int now
{ok i fixed it to a int but from what i can see it i getting hung up on the switch}
If you want to go back to the menu, you need to put it all in a loop. Otherwise it will take a selection, execute it, and continue on toward the end of the program.
As mutexe pointed out, you formatting is really bad making it hard to see what is happening.
It works for me and goes through hw1() fine, I did not verify if the answers were right though or that everything printed correctly. However, I am pretty sure that you do not want lines 94 and 95 at the end of the hw1().