Mail Archives: djgpp/1998/10/08/21:39:57
It's quite possible for two different variables in 2 different function to
have the same value, if they're automatic variables.
Ex
foo() {
int x;
x = 10;
}
bar {
int x;
printf("%d\n",x);
}
...
foo();
bar();
would in all probalility print 10;
since function calls and returns don't change the value on the stack were x
is stored in both sub's.
-----Original Message-----
From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Date: Wednesday, October 07, 1998 8:42 PM
Subject: Re: -KWII- About my stupid questions!!!
>Uhfgood wrote:
>
>> if I have a variable that has the same name and type in two seperate
functions,
>> how can their values be the same, aren't they supposed to be different?
>
> They are, and will be different. Post a simplified version of the
problem here
>if you still can't figure it out.
>
>--
> (\/) Endlisnis (\/)
> s257m AT unb DOT ca
> Endlisnis AT GeoCities DOT com
> Endlisnis AT BrunNet DOT Net
>
>
- Raw text -