A small question regarding #define

1. #import <iostream>
2. using namespace std;
3. #define say 'cout'
4. int main()
5. {
6. say<<"Hello World";
7. return 0;
8. }

Is line 3. possible?
If not, why?

Thanks,
Sort of, but what would you gain from that?
I think he's doing it as a learning experience, testing the limits of what is possible.
If you remove the single quotes ' from around cout, then yes it is.
Also, you should #include <iostream>, not #import
Topic archived. No new replies allowed.