Tut by TheEliteOne
Calling Functions in C++
Lets say we want a title, like this:
at the top of the screen, but we don't want to type in cout<<"TheEliteOne's Example!\n\n"; every time. We can use a function and call it every time we want to. Like this:TheEliteOne's Example!
I don't know about but I would rather type in some thing like "title();" than "cout<<TITLE OF YOUR PROGRAM\n\n"; " every time I wanted to ;) hope it helped.Code:#include <iostream.h> void title() { cout<<"TheEliteOne's Example!\n\n"; } void pause() { system("pause"); } void cls() { system("cls"); } int main() { First: cls(); //Calls are cls function. title(); //Calls are title function. cout<<"See.. not that hard right?\n\n"; pause(); //Calls are pause function. goto First; }