> Am I wrong?
Yes, unless it is inlined by the compiler. The inline specifier can be ignored, so it doesn't guarantee inlining.
Not sure I understand..doesn't the inline specifier ask the compiler to replace the function call with the body of the function instead?
Yes. A function exists only in one place in memory. There are never two identical functions on different places. That would defeat the purpose of a function.
Or in the case of inlining, the compiler puts the contents of the function (or the body if you will) in place of the function call. So in that case, it exists nowhere.
Although, granted, I don't know what happens if you try to get a function pointer from a function that can be inlined. Either the function will never be inlined or it will be inlined where possible but remain in memory.
What I meant was that, like an array exists as a block of contiguous memory, so must a function? In other words a function takes up more than one address in memory does it not? ( as a function has to be bigger than an individual element, for example a character which only occupies one address)
Sorry if I'm just confusing matters.
No, that cannot possibly be true. The array has one starting memory address where it takes up a number of contiguous bytes.
But the array itself starts at the memory address X. Similarly, a function does so, as well. What you are implying is that it's an array of instructions. Then that might hold true.
So function[1] would return the 2nd instruction in the function and so on.
But the C standard doesn't mandate any such thing...