Question : Can you explain this syntax please?

Hi Experts,

Does this code snippet logic mean:

"my_var doesn't equal the value in no way, shape or form"?

And also, what would it be used for?

Thanks
1:
$my_var<>"value"

Answer : Can you explain this syntax please?

Hi learningunix,

the line checks if the left-most byte of 'num' is '1'.

'&num' is a pointer to the memory address where the first byte of 'num' resides. The '(char*)' casts this pointer '&num' (which is a pointer to int) to a pointer to char. Since char is a one byte data type accessing that 'pointer to char' with '*' accesses the first byte of the int. In little endian this byte has to be '1' for and 'int' which is '1' - in big endian the first byte would be '0' since the least significant byte is the most right one ...

Hope that helps,

ZOPPO

Random Solutions  
 
programming4us programming4us