Hello!
I need to know if there is some way to have multiple codes in one C++ project. As in the main code, then some branching codes, but the entire thing fits in one .exe file.
Can someone tell me a way to do this?
and if there is none, can you tell me a way to "fake" this affect?
If you mean multiple cpp files that compile to one program, then just compile the files at the exact same time (most IDEs have features to allow you to do this known as projects or solutions). Be sure that the variables/functions/objects are declared in both files (though for variables you'll need the extern keyword).
uuummm...
Not what Disch said.
I mean multiple cpp files.
So I am able to have multiple cpp files in one project?
And when compiled, it makes 1 .exe?
Ok, so how do i do that?
lets say the main code is called "getthename" and the other is called "ihavethename."
If the user inputs "bill" into the main code, how could i make it run the second code?
In your header file, declare (but do not define) a function. Include that header file in your main cpp file and your other file. In your other file, implement that function.