Problem with binary &

Started by
2 comments, last by Oberon_Command 18 years, 2 months ago
I'm currently writing the memory management section of my operating system, but I've got a problem with my malloc() function. Specifically, the compiler doesn't like my use of the binary AND operator here:

if ((currentMemory & (1<<loops)) == (1<<loops))
To the best of my knowledge, this is a correct statement. Even when I replace the whole (1<<loops) thing with a constant, it still spits out the same error. Can anybody tell me what is wrong with this statement?
Advertisement
What is the error?
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Is currentMemory a pointer? You can only use the binary & operator on integer types.
Quote:Original post by ZQJ
Is currentMemory a pointer? You can only use the binary & operator on integer types.


That was it! Thanks a lot, that had me puzzled for a while.

This topic is closed to new replies.

Advertisement