How does this function work?
OK so a friend of mine showed me a function which reverses a string of numbers. But I don't understand how it works for the part with the variable 'count'. If I change it to anything other than 'count/2' it gives a different answer. But, he did nothing with 'count' except declare it in the main function. Why does it work? And how does it work? What value will 'count' have if no value has been assigned to it in the first place?
Please assume that the variables are already declared in a function that calls it.
I'm pretty new to all of this and the simpler explanations would be very helpful! Thanks in advance to those who will help. :D
void reverse (int *num, int count)
*(num+i)=*(num+i) + *(num+9-i);