check range of unsigned long

W

Wenjie Zhao

Hello,

Suppose I have a Validator class who is used to check
inputs from other interface classes' input. Particular
there is

bool Validator::checkUnsignedLongRange(unsigned long start, unsigned
long end, unsigned long value) {
return (start <= value) && (value >= end);
}

I am concerned with unsigned comparisons here when (for convenience)
use hex presentation:
validatorObject.checkUnsignedLongRange(0x00000000, 0x00016FFF);

Is the above 0x presentation OK in the context?


Best regards,
Wenjie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,573
Members
45,046
Latest member
Gavizuho

Latest Threads

Top