Skip to content
Permalink
2bfcae8bc5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
24 lines (18 sloc) 506 Bytes
#include <iostream>
using namespace std;
/*
Macros2, more of an extended part to macros.
*/
#ifndef name // if not defined
#define name "Taran" // define name = "Taran"
#endif // close if statement
#define age 19 // pre define age
#ifdef age // if age defined
#define no_age 99 // define no_age = 99
#endif // close if statement
int main() {
cout << name << endl; // prints "Taran"
cout << age << endl; // prints "19"
cout << no_age << endl; // prints "99"
return 0; // return 0
}