Is it possible to redefine a c++ keyword using #define?
#ifdef int
#undef int
#define int 2
#endif
int main(){
//Do something with int
}
I can't see the output in this case but i want to understand what happens internally. The reason I don't have #define is that I found that it is possible to #define a reserved keyword if you don't use a standard header file. I also tried to do run the following code.
#include<iostream>
using namespace std;
#ifdef int
#undef int
#endif
int main(){
cout<<int;
}
But te above throws the error at cout line.