Hi I’m tryng to run this macro example the following way:
root macro.c
{
#include <iostream>
cout << " Hello" << endl;
float x = 3.;
float y = 5.;
int i = 101;
cout <<" x = "<<x<<" y = "<<y<<" i = "<<i<< endl;
}
Output:
root [1] .x macro.c
/stash2/user/tkorokn/workflows/outputs/1485500180/./test.c:4:5: error: unknown type name 'cout'
cout << " Hello" << endl;
^
/stash2/user/tkorokn/workflows/outputs/1485500180/./test.c:4:10: error: expected unqualified-id
cout << " Hello" << endl;
^
/stash2/user/tkorokn/workflows/outputs/1485500180/./test.c:8:5: error: unknown type name 'cout'
cout <<" x = "<<x<<" y = "<<y<<" i = "<<i<< endl;
^
/stash2/user/tkorokn/workflows/outputs/1485500180/./test.c:8:10: error: expected unqualified-id
cout <<" x = "<<x<<" y = "<<y<<" i = "<<i<< endl;
Now after this if I type:
root [2] cout << " Hello" << endl;
Hello
It works. Why does it not work with the macro?
Thanks!
Tibor