I can only use bitwise operations and pointer arithmetic to solve this problem. I am converting from binary to unsigned int.
The function I am writing is:
unsigned int atob(const char* nptr);
atob("101") should return 5, atob("11000") should return 24, atob("11$") should return 3, and atop("") should return 0.
I'm pretty new to bitwise operations, so I really need some help specifically in that area.
edit:
nptr can only be incremented, not other inc/dec's are allowed.
*and+? (Hint:*2 === <<1,+can here be done with|.)atob("101") should return 3I think you meant 5?