Hi all, I'm new here and I'd first like to say hi! Anyway, I've been programming in Java for a while, and one of my courses recently required that I pick up C. I've tried searching and reading up on pointers already, but would still require help with the following:
Actual Code:
To be rewritten using the following function prototype:Code:int mystery1(int n) { int bit; if (n == 0) return 0; else { if (n & 1) bit = 1; else bit = 0; return bit + mystery1(n/2)*2; } }
Where B and C are just placeholders. I'd just need some help in pointing me in the right direction, such as what B and C are? Thanks!Code:void mystery1(int *n, B C)



LinkBack URL
About LinkBacks




Clearly the function should be rewritten like this if your teacher really didn't elaborate at all on what needs to be done: