In C, if an inline function declared before the main()
, but the definition was after the main as follows:
inline int sum(int x, int y);
int main()
{
int z;
z= sum(2,2);
}
inline int sum(int x, int y)
{
return x+y;
}
or if we made the declaration without inline like this:
int sum(int x, int y);
int main()
{
int z;
z= sum(2,2);
}
inline int sum(int x, int y)
{
return x+y;
}
Will the compiler deal with the function in both cases as inline (replacing the function call with the actual function body)?