![]() |
|
#1
|
|||
|
|||
PointersMy program has functions that need to be able to access data from each other. So basically, I need to know where to put the pointers, as much help as you could give me...
Also, my last function is supposed to loop the entire program over again if they answer yes, how do i do this? thanks for your time. CPP / C++ / C Code:
Last edited by admin II : 22-Mar-2007 at 08:06.
Reason: Please surround your C code with [cpp] ... [/cpp]
|
|
#2
|
||||
|
||||
Re: PointersStart by reading the Guidelines
Also this about main() You need to actually put a loop in main() in order to "loop the entire program over again," probably a do/while loop is best. How much of the program works? Since we're coming in cold, you need to give us a little information, not just a couple hundred line of code and ask us to help fix it.... __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#3
|
|||
|
|||
Re: PointersI just don't know the way to pass the information given to one function to the next, and then so on... For example i need to pass the "gross_pay" from get_employee_info to the ltb function... i first declare the variable in main? and then where do the asterisks or ampersands go?
this is the part of the code i'm speaking about: CPP / C++ / C Code:
Last edited by LuciWiz : 22-Mar-2007 at 15:43.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#4
|
|||
|
|||
Re: PointersInstead of this:
CPP / C++ / C Code:
CPP / C++ / C Code:
Last edited by admin : 23-Mar-2007 at 20:52.
Reason: Attempt at correcting previous edits
|
|
#5
|
||||
|
||||
Re: PointersLooks like I completely wasted my time responding, and trying to help....
Hint taken. __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#6
|
|||
|
|||
Re: PointersHi lyojarhhs,
First of all, do you know what a pointer is? Well the answer in short is: It is pointing to the address of a variable or NULL (which points to nothing) A value for a vairalble is stored at a certain memory address. In addition, a pointer is also a memory address, in which storing the address of the variable its pointing to. For example: CPP / C++ / C Code:
One main advantage of using pointers is to passing by reference to functions instead of passing by value. And also to save resources as values need no be duplicated as passing by value. The later is more important in embedded systems where resources are limited. Hope this helps!!! |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sort an array of structures | sassy99 | C Programming Language | 10 | 15-Feb-2007 08:46 |
| Pointer Usage in C++: Beginner to Advanced | varunhome | C++ Forum | 0 | 19-Aug-2005 10:25 |
| [Tutorial] Pointers in C (Part II) | Stack Overflow | C Programming Language | 0 | 27-Apr-2005 18:36 |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 19:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The