Maybe this piece of code could work? (I'm not an expert):
//Header files up here
bool thinkingProcessDone = false;
int main()
{
string name;
getline(cin, name);
//Think and show progres bar
thinkingProcessDone = true;
cout << "Ended with exit code 1";
if (thinkingProcessDone) {
getchar();
}
return 1;
}
This might not be what you're asking, but it's the best I can come up with.