CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2007
    Posts
    609

    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.
    http://www.uovalor.com :: Free UO Server

  2. #2
    Join Date
    Jun 2006
    Location
    M31
    Posts
    885

    Re: can this cause issues?

    Quote Originally Posted by Red Squirrel View Post
    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.

  3. #3
    Join Date
    Jul 2007
    Posts
    609

    Re: can this cause issues?

    Oh right I forgot bout typedefs, I used that instead. Thanks.
    http://www.uovalor.com :: Free UO Server

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured