loading...

re: Bitwise Operations in C/C++ VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Can you give some examples when we need bitwise shifting? I’m writing JS and can’t figure out why would I need to use shift.
 

Well, you use them when you want to know the values of bits. Tons of systems encode information on as few bits as possible to save space. Compression algorithms map character strings and numeric values to packed bit streams. Transmission protocols store flags and sometimes node addresses as some number of bits that aren't byte multiples. It's ubiquitous in embedded systems.

code of conduct - report abuse