| | |
Help with House Program
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 45
Reputation:
Solved Threads: 11
Yes you need to else you work with garbage values.
May be you didn't quite get it,by using an ampersand you actually give the function true memory addresses of
initial, fuel, taxRate
to directly make changes
If you don't use them,a COPY will be created and
initial, fuel, taxRate
won't have values which you originally entered in
void displayInstructions(..)
Since you enter these values in the function
void displayInstructions(..)
and then later use it in some other computation,don't you need the actual values which were entered in the
And yes in main()
it should be
May be you didn't quite get it,by using an ampersand you actually give the function true memory addresses of
initial, fuel, taxRate
to directly make changes
If you don't use them,a COPY will be created and
initial, fuel, taxRate
won't have values which you originally entered in
void displayInstructions(..)
Since you enter these values in the function
void displayInstructions(..)
and then later use it in some other computation,don't you need the actual values which were entered in the
C++ Syntax (Toggle Plain Text)
void displayInstructions(.....) //??
it should be
C++ Syntax (Toggle Plain Text)
int main() { float initial, fuel, taxRate; displayInstructions(inintial,fuel,taxRate);//No ampesrand here
Last edited by zalezog; Mar 30th, 2009 at 4:29 pm.
![]() |
Similar Threads
- What's the HARDEST program you've written? (Computer Science)
- Need help with the 5 mouse click house program (Python)
- program error for cd burner program (Windows NT / 2000 / XP)
- SLOT MACHINE PROGRAM... Help plsss! (C)
- TROJ STILEN.A, ADW RULEDOR.C, BKDR SANDBOX.S detected using Trend Micro House Call (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: factorial using a for loop
- Next Thread: Dynamic Memory Allocation
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph homeworkhelp iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





