C++返回main

Luk*_*rry 0 c++ program-entry-point qt-creator

我希望能够从另一个文件返回到main.cpp文件.例如.

// Main.cpp
#include "Globals.h"

int main()
{
    otherFile();
}

// Globals.h

#include <iostream>
#include <stdlib.h>

bool otherFile();

//otherFile.cpp
#include "Globals.h"

bool otherFile() 
{
    // do stuff
    // Here I want to be able to go back to the main.cpp file.
}
Run Code Online (Sandbox Code Playgroud)

对不起,如果我的问题毫无意义

Ign*_*ams 8

return将控制权返回给调用者,在这种情况下,调用者将main()在main.cpp中.