I tried to write a program that takes input as a string and then passes that string to a macro which is supposed to insert the string as a plain-text expression but the macro is not behaving as I would suspect.
#include <iostream>
#include <cmath>
#include <string>
#define PARSE(a) a;
using namespace std;
int main() {
string c ;
int b;
cin >> c;
b = PARSE(c);
cout << b;
return 0;
}
This code will not compile, it gives an error saying that I cannot convert string to int, however PARSE(c) should not be treated like a string it should just be replaced by plain text.