Here are different kinds of templates i use for exercise or my own apps
Simple
Code: Select all
#include <iostream>
using namespace std;
int main() {
system("PAUSE");
return 0;
}
Any functions go before the using namespace std;
int main() is the main function of the program.
Enter all the C++ statements before system("PAUSE");
Infinite Loop User-Terminated
Code: Select all
#include <iostream>
using namespace std;
int main() {
while(1) {
//Statements
//Somehting to terminate, example press 0 and enter to exit
// otherwise keep going
}
system("PAUSE");
return 0;
}
These are just suggested templates for C++ and you do not have to use them but are simple and easy to use.