Header files

Hello All,
Here is a very basic question that has been stumping me.

I have two files test.C and r2p.h

// Main file. Test.C #include "r2p.h" { gROOT->Reset(); FILE *t; t=fopen("TEMPLATEFILE","r"); fclose(t); printf("%i\n",add(1,5)); printf("Hello\n"); }

and

// r2p.h int add(int,int); int add(int a,int b) { return a+b; }

When I run root, I get:
$root -b -q -l test.C
root [0]
Processing test.C…
$

Sorry for the post. I should have experimented a bit more.

Changing it to

#include "r2p.h" void test() { gROOT->Reset(); printf("%i\n",add(1,5)); /* FILE *t; t=fopen("TEMPLATEFILE","r"); fclose(t); */ printf("Hello\n"); }

took care of everything.

Could not figure out how to delete the post.

Indeed, in unnamed macro (your first example) everything must be between the curly braces.

Cheers,
Philippe