|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
|
C++ Function by Refrence (Passing Parameters by reference)
I have an issue concerning passing variables by reference. I have some code for you C++ experts to look at. I have seemed to narrow down all the conventional errors and I am left with only 2 of them. The first is:
Code:
839 error LNK2019: unresolved external symbol "void __cdecl getMinutes(void)" (?getMinutes@@YAXXZ) referenced in function _main Code:
839 fatal error LNK1120: 1 unresolved externals heres the full code: Code:
#include |
|
|
|
|
|
#2 |
|
Member (10 bit)
Join Date: Jul 2002
Location: University of California, Santa Barbara
Posts: 800
|
In the function prototypes you spell it "getMinutes", but when you define it you misspell it as "getMinuets".
Also, there is no reason that I can use to pass variables by reference, I would use a return statement to make the code read a bit easier. And just a suggestion, if you are going to have a display string in the parameters of those "get" functions, you could generalize even further and add a minimum and maximum input range and have a generic "int getInteger(string prompt, int min, int max)", or something like that. Last edited by mattg2k4; 02-14-2005 at 09:39 PM. |
|
|
|
|
|
#3 |
|
Member (7 bit)
|
I feel like a moron
I'm embarrassed.. Thanks for replying to my post. I'm doing my project like this because it is an assignment to use pass by refrence. Thank you very much.
Last edited by HNPFL; 02-15-2005 at 04:04 PM. Reason: improper grammer |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|