Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

oveja-carnivora

using #defined values

This topic is 5919 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

can anybody tell me why I cant divide by a #defined value? ex- This C++ syntax doesnt work: #define X 5 long Y = 3; long Z = Y/X; but this does: #define X 5 long Y = 3; long Z = Y/(X+0); Thanks, Ben

Share this post


Link to post
Share on other sites
Advertisement
I mean that it gives me a syntax error on the character after the #defined value, my actualy code is:

#define LoadStepNum
...
long LoadBarProgress = 0;
...
LoadBarProgress += screenwidth / (LoadStepNum + 0);

without the () and the + 0 it gives me a syntax error on the '';''

this doesnt make any sense, so thanks for the help

-Ben

Share this post


Link to post
Share on other sites
Only thing I notice is that you don''t have anything defined for LoadStepNum. Make sure there''s a number in there, and make sure that you''ve got it written as:

#define LoadStepNum 7

No equal sign or anything...

Although I''m betting you''ve already got it like this and it was simply a copying error.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
how stupid can you be...
I''ll bet you''ll be the best error programmer world wide
lol

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!