Greetings,
I am not having a problem compiling or locating an error. I am wondering if there is a way to actually look deeper into what is happening behind the scenes. For example I am presently reading a book on Mathematics to Genereric programming. I have found this book to be very enlighting so far but I am trying to under what is happening to the code behind the scenes. I know in Visual studios the IDE will show you the binary while debugging. Is there a way I can see it with xcode as well? I will show you an example of the I am break pointing to so that I what's happening.
// Helper methods
bool odd(int n) { return n & 0x1; }
int half(int n) { return n >> 1; }
I want to see what is happening with the return n & 0x1 values. I was also trying to debug the bit shifting method as well to see the values and what is going on.
Here is the code I am running it against with some random values.
Again, the program works. I am trying to see what is happening with bit shift and the n & 0x1 code.
// Method
int multiply1(int n, int a)
{
if(n == 1) return a;
int result = multiply1(half(n), a + a);
if(odd(n)) result = result + a;
return result;
}
P.S.
I do realize the code is not optimized. I am just trying to get more details out of my debugging.