Answer to Question #67217 in C++ for Eunsu Kim

Question #67217
#define KB * (0x1 << 10)

I think it's written to show kilobyte as KB. what is * (star) ??

what is difference with this "#define KB (0x1 << 10)" ??

thanks
1
Expert's answer
2017-04-11T01:54:07-0400
Firstly, star (*) sign means a pointer (or reference) to a variable.

Secondly, there is impossible to get the address of const value (0x1 << 10), so calculation of expression *(0x1 << 10) will always cause a compilation error.

Also, probably, the task is incomplete to understand what is asked correctly.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS