|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
I have these two voids that each call on the other. This is because one refreshes the screen and handles some other stuff, the other asks a question. The question one calls on the refresh after an answer is given and then the refresh ends up calling on the question again to get another answer.
The problem is, when I go to compile, it acts as if the other void doesn't exist if it's below the current one. I am using the MinGW port of GCC for Windows. Is there a compiler option or something to fix this? Am I just not writing my code right? Note: I am a new to C++ but not to programming. |
|
#2
|
||||
|
||||
|
Are you declaring both of these functions in a header file?
|
|
#3
|
|||
|
|||
|
Ah, nope. So I would just use something like "void VoidName();" in an .h file and include it? I knew I should have been able to find it myself if only I knew what I was looking for
.Thanks |
|
#4
|
||||
|
||||
|
Quote:
|
|
#5
|
||||
|
||||
|
You could do that or you could make a protoype of last void at the top. Something like
#include <iostream.h> void showoptions(void); void main(void){ cout<<"Select one of the options:\n"; showoptions(); } void showoption(){ cout<<"1) do this and that\n 2) dont do this and that\n"; //etc } Pardon me if something obvous is messed up - I'm more of a c guy rather then c++ ![]()
__________________
And you know I mean that. |
|
#6
|
||||
|
||||
|
Quote:
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Help: Function Placement in C++ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|