Difference between macro and function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#define Message "Welcome to" #define SITE "T4Tutorials.com" #define YEAR 2020 #include <iostream> using namespace std ; int main() { cout << Message << endl << SITE << endl; cout << endl << "YEAR is: " << YEAR ; cout <<
endl << "Next YEAR is: " << ((YEAR)+1) << endl ; return 0 ; } |
Output
Welcome to
T4Tutorials.com
YEAR is: 2020
Next YEAR is: 2021