![]() |
|
#1
|
|||
|
|||
Function access problemHello everyone, I need a little help with a program, acctualy with a part of it. I'm trying to make a program that represets the functioning of a cash dispenser using functions so that I can return to the first menu at anytime, but I can't access a function that hasn't been declared up to that point.
I haven't done much with the code because of the problem above, the only compiler error is the following: "implicit declaration of function 'int main()' " CPP / C++ / C Code:
As you can see the code is written up to the part where the user has to type one of the options provided, after that the program ends. I want to make it work so that the user can return to the first menu typing a '0'. Any ideas on how I could do this preferably using functions would be appreciated. |
|
#2
|
|||
|
|||
Re: Function access problemI'm not sure if you can call main() like that. What I would do if I were you is take all the stuff in main() and put it into a new function called MainMenu(). This way, in main() you can just call MainMenu().
|
|
#3
|
|||
|
|||
Re: Function access problemLike this?:
CPP / C++ / C Code:
Please tell me if I got you wrong. Thanks |
|
#4
|
|||
|
|||
Re: Function access problemThat looks like what I was saying. Also, just out of curiosity, why does usermenu() return an integer?
|
|
#5
|
|||
|
|||
Re: Function access problemGood thing I undrstood, but I keep getting almost the very same problem: implicit declaration of function 'int mainmenu ()'
It won't compile as before. The answer for the second one is because I thought it was needed to exit the function and the program. |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help with input files. | Efferus | CPP / C++ Forum | 2 | 24-Nov-2007 16:19 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| [Tutorial] Function Pointers | aaroncohn | CPP / C++ Forum | 4 | 17-Feb-2006 11:33 |
| Revising Script style ?????? | pepee | MySQL / PHP Forum | 4 | 14-Apr-2004 04:59 |
| Another problem dealing with main() and driver function | tommy69 | C Programming Language | 4 | 20-Mar-2004 19:46 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The