Defines
---------
Calling Functions#include <iostream.h>
#define lol cout<<"Hello World!\n\n"; //Treats the word lol as "cout<<"Hello World!\n\n";
int main()
{
lol
system("pause");
}
-------------------
Goto Commands#include <iostream.h>
void Function()
{
cout<<"World!\n\n";
system("pause");
}
int main()
{
cout<<"Hello ";
Function(); //Calls the function
}
------------------
Strings#include <iostream.h>
int main()
{
Start:
system("cls");
cout<<"Hello World!\n\n";
system("pause");
goto Start;
}
--------
#include <iostream.h>
#include <string>
using namespace std;
string x;
int main()
{
cout<<"Enter a word: ";
cin >> x;
system("cls");
cout<<"The word entered is: " << x << "\n\n";
system("pause");
}
Bookmarks