-
January 3rd, 2009, 10:56 PM
#1
can this cause issues?
one of my program deals with a lot of "long unsigned ints" which can make a function very long and hard to follow.
I put this at the start of my program:
#define uint long unsigned int
So I can use uint to declare one. It works, but could this cause a problem down the line? I can't see how, but thought I'd check so I don't run into any surprises later. i want to start using uint throughout my whole program.
-
January 3rd, 2009, 11:01 PM
#2
Re: can this cause issues?
Originally Posted by Red Squirrel
It works, but could this cause a problem down the line?
Yes. The pre-processor doesn't care about language rules. Things like scope obedience are non-existent, for example.
As a general rule of thumb, avoid using the pre-processor when a language feature (a typedef, in this case) can do the job.
-
January 3rd, 2009, 11:59 PM
#3
Re: can this cause issues?
Oh right I forgot bout typedefs, I used that instead. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|