If I understand your question correctly, you're asking how do you have a main function in C++ that returns void. (i.e.)
#include <iostream>
void main() {
std::cout << "Hello, World";
return;
}
Short answer - you don't. C++ requires main() to return an int. To be honest, even when C "allowed" it, the app still returned an error code. It was just always 0. This is functionally equivalent to what a void function did in C:
#include <iostream>
int main() {
std::cout << "Hello, World";
return 0;
}