This is straight from the GeeksForGeeks' tutorial on C page: https://www.geeksforgeeks.org/interesting-facts-preprocessors-c/
#include <stdio.h>
inline int square(int x) { return x*x; }
int main()
{
int x = 36/square(6);
printf("%d", x);
return 0;
}
// Output: 1
I get the error:
/tmp/ccSHJFrH.o: In function main':
a54a7786ee0a4f730407c05eb1147f5f.c:(.text+0xe): undefined reference to
square'
collect2: error: ld returned 1 exit status
For some reason this compiles when compiling with C++, but with C, I get the error message above. I am running this on the IDE on the GeeksForGeeks website.