In code.c
In test.cCode:int accum = 0;
int sum (int x, int y)
{
int t = x + y;
accum += t;
return t;
}
I useCode://#include "code.c"
int main()
{
return sum(1,3);
}
and get code.oQuote:
gcc -O2 -c code.c
It's interesting to see I don't have to include code.c in my code, why is that?Quote:
gcc -O2 -o prog code.o test.c