Jump to content
  • Advertisement
Sign in to follow this  
yurian

I am baffled, what could I be doing wrong?

This topic is 3976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!