S
star_night
Hi,
I am starting to learn C laguange. I am using gcc 3.3.2 on
Solaris10(SPARC).
test1.c
-------
main()
{
int i =3;
printf("\n Address of i = %u", &i);
printf("\n Value of i =%d", i);
printf("\n Value of i =%d", *(&i));
}
gcc test1.c succeeds. How gcc knows where to find printf? I
deliberately set GCC_EXEC_PREFIX to /tmp in my shell to make it fail,
but this does not work. I guess, the question is how to make gcc forget
default search locations for libraries.
Sometime in the past I read that to get printf working, you should
include stdio.h. Is that not a requirement anymore?(again standard
includes kicking in?)
Thanks
SN
I am starting to learn C laguange. I am using gcc 3.3.2 on
Solaris10(SPARC).
test1.c
-------
main()
{
int i =3;
printf("\n Address of i = %u", &i);
printf("\n Value of i =%d", i);
printf("\n Value of i =%d", *(&i));
}
gcc test1.c succeeds. How gcc knows where to find printf? I
deliberately set GCC_EXEC_PREFIX to /tmp in my shell to make it fail,
but this does not work. I guess, the question is how to make gcc forget
default search locations for libraries.
Sometime in the past I read that to get printf working, you should
include stdio.h. Is that not a requirement anymore?(again standard
includes kicking in?)
Thanks
SN