S
Srinu
Hi all,
Can we assign return value of a function to a global variable? As we
know, main() will be the first function to be executed. but if the
above is true, then we have a function call before main. Please help
me calarifying this. The code may be of the form.
int f();
int x = f();
int main()
{
printf("%d", x);
}
int f()
{
x=9;
}
In Turbo C++ compiler, it gives x = 9; how is this possible?
Srinu.
Can we assign return value of a function to a global variable? As we
know, main() will be the first function to be executed. but if the
above is true, then we have a function call before main. Please help
me calarifying this. The code may be of the form.
int f();
int x = f();
int main()
{
printf("%d", x);
}
int f()
{
x=9;
}
In Turbo C++ compiler, it gives x = 9; how is this possible?
Srinu.