I am baffled, what could I be doing wrong?
#include <allegro.h>
#include <cstdlib>
#include <time.h>
#define edeadplace 250
#define pdeadplace 70
#define p 100
#define e 540
#define y 240
#define center 320
srand(time(NULL)); //error line
I am totally baffled! This is only the first few lines of my program, and I already have an error! "Expected constructor, destructor, or type conversion before '(' token"
"Expected ',' or ';' before '(' token"
What could I be doing wrong? I have done srand correctly as in my for dummies book. What could it be?
Btw, almost all lines lines after this have the exact same error.
I think because you are trying to call the function outside the scope of main, the compiler thinks it is a function or class declaration. Try moving the srand call into main.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement