Run functions under what?

I downloaded some source codes that I compiled, and when I run it nothing happends, just a regular cmd box appears and closes, I added int main into one .cpp file.

My first question is do I need to add int main in order to get the program working as a .executable file?

I added int main bcuz of a crtMainstart up error, when I added a other code under the int main function from the project it works while if I put it outside out of the int main function it doesn't. So how I would make all classes, structures to work under as the same behaviour that the int main function does? Is there any main header file I would need to include?
closed account (zb0S216C)
Closure of a console window is not meant to be postponed. Running the program through command prompt will preserve the program's output history.

leoo wrote:
"I added int main into one .cpp file."

Don't do that. Not all programs use "int main( )" as the entry-point.

Wazzak
Okay, thanks, and I saw that my source files that I had downloaded had vc++ menus, so it had a missed entry-point, I included them into the project. So it's fixed now.
Topic archived. No new replies allowed.