• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ One doubt

In every strongly typed language, (A) value generally is called an explicit cast.

It means fitting the bits value (which has a given type, lets say it has the type B for the sake of the explanation.) into the type A representation of the same bits value.

For example, uint32 and int32 have the same number of bits available to allocate values, but they are different representation of those bits. In other words, the number of different values they can allocate is the same, but they represent different ranges.

Since int32 uses one bit for the sign (+ -) it may only hold values from –2,147,483,648 to 2,147,483,647
Uint has a range of 0 to 4,294,967,295.

EDIT: I just saw this is a C++ thread. I'm most familiar with C#, but the same explanation holds for strongly typed language so...
 
Last edited:
same explanation holds for strongly typed language so...
c/c++ is not 'strongly' typed language because pointers can bypass typing system, i think they call it 'weakly' typed language
short explanation: just the value changes, and the cast is redundant.
it's not redundant, if you're dealing with bitwise operations then you could need a 8byte long variable otherwise it will be overflowed, since by default integers have 4 bytes long.
(int64_t)0 to (int64_t)1?
nothing both are just numbers like any other, if you meant a type conversion '(int64_t)' would be the same as '0LL' or '(long long)0' which mean a variable capable to represent numbers up to 8 bytes long depending on your system, it can be 4 bytes long if your machine doesn't support 64bit-long instructions extensions.
 
Back
Top