#include <iostream> using namespace std; #define PI 3.14 #define CircleArea(r){r*r*PI} void macroFunc8(); #define Multiply(x,y){x*y} void macroFunc9(); int main() { macroFunc9(); return 0; } void macroFunc9() { int x=100,y=200; int z=Multiply(x,y); cout<<"x="<<x<<",y="<<y<<",z="<<z<<endl; double d1=100.1,d2=200.2; double d3=Multiply(d1,d2); cout<<"d1="<<d1<<",d2="<<d2<<",d3="<<to_string(d3)<<endl; cout<<"Finished in macroFunc9() and now is "<<getTimeNow2()<<endl; cout<<to_string(d1*d2)<<endl; free(uuidValue); free(dtValue); } void macroFunc8() { int radius=100; double area=CircleArea(radius); cout<<"Circle area is "<<area<<endl; }
Compile via below command
g++ -g -std=c++2a -I. h1.cpp -o h1 -luuid
Run ./h1