1

could any please explain the below code

const uInt32 eVal = 8ul;
const uInt32 fVal = 5ul;
const uInt32 zVal = 0ul;

what does ul and numbers 8,5,0 are stand for

1

2 Answers 2

4

It's the programmer being unnecessarily verbose. ul is the prefix for an unsigned long literal, so 8ul has an unsigned long type.

Most likely, that isn't the same type as the uInt32, so really the code you present is an exercise in obfuscation. Really they should rely on the automatic implicit conversion rules and write

const uInt32 eVal = 8;
const uInt32 fVal = 5;
const uInt32 zVal = 0;

perhaps even preferring constexpr in place of const.

Reference: http://en.cppreference.com/w/cpp/language/implicit_conversion

Sign up to request clarification or add additional context in comments.

Comments

2

ul stands for unsigned long representation of numbers. Here the number 8 or 5 or 0 of type unsigned long is being assigned to constant uInt32 type variable.

The 'ul' is used for representation. It need not be used also.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.