main function

hello everybody,
I have a weird question somehow, can we have more than one main function in a project? I mean for example 2 .cpp files where each has its own main, but they're both in the same project.
No. Not unless you use #defines or something else to limit it to only one main when the compiler sees it.
let me put it this way, i'm using MPI, where a process can spawn another process. however, in order to spawn a new process while run-time, you should have a .exe file already existing. which means another program, which means another main. can you see my point?
As long as you compile them as different programs, you can have two files which define a main function
that's what I did so far, but how should I point to the master program where the slave program is?
Are you using some IDE?
yep, visual studio 2005
I guess it's a little far from what am seeking, process in this link is considered as a part of program, whereas process in my case is by itself a program.
Topic archived. No new replies allowed.