H
Haskell Prelude
Hello Friends -
Can anyone answer these C questions?
1. What is the effect of making an internal (local) variable static?
2. What is the effect of making an external (non-local) variable static?
3. What, possibly including garbage, is output by the following code?
int a = 10;
int b = 12;
ftn2(int a) {
int c = 13;
printf("%d\n", a+b);
return ++a;
}
ftn(int b) {
b = a;
printf("%d\n", b);
return ftn2(a);
}
void main()
{
int x = ftn(b);
printf("%d\n", x);
}
Thanks to all!
Can anyone answer these C questions?
1. What is the effect of making an internal (local) variable static?
2. What is the effect of making an external (non-local) variable static?
3. What, possibly including garbage, is output by the following code?
int a = 10;
int b = 12;
ftn2(int a) {
int c = 13;
printf("%d\n", a+b);
return ++a;
}
ftn(int b) {
b = a;
printf("%d\n", b);
return ftn2(a);
}
void main()
{
int x = ftn(b);
printf("%d\n", x);
}
Thanks to all!