I'm trying to better understand the & operator (address-of) for use within an API.
Here is my example API function signature:
apiFunction(const int*)
I am working on somebody else's code and they are using the API as follows:
int inputs[1] = {1};
apiFunction((const int*)&inputs);
I would think the correct usage should be:
int inputs[1] = {1};
apiFunction(inputs);
Is there a difference between 'inputs' and '&inputs' when 'inputs' is a char array with length 1?
They looks the same when I do a printf, but I fear that I may be formatting it incorrectly:
printf("%p, %p", inputs, (const int*)&inputs);
Output (for example):
0204DE94 0204DE94