Consider the following two blocks of code, found in separate files:
/* main.c */
int main()
{
int i=0;
foo();
return 0;
}
/* foo.c */
int i=1;
void foo()
{
printf(“%d”, i);
}
What will happen when you attempt to compile, link, and run this code?
- It will fail to compile.
- It will fail to link.
- It will print " $0$ ".
- It will print " $1$ ".