Mail Archives: djgpp/1996/06/11/20:47:53
In article <4phibg$sek AT usenet DOT rpi DOT edu>, calvid AT cortez DOT its DOT rpi DOT edu says...
>
>[SNIP]
>struct big
>{
> int array[10000];
>}
> /* [SNIP] */
>big zero;
>big *one;
>big *two;
>big *three;
>
>one = two = three = &zero;
>
>1) Obviously the first line, big zero, will allocate 40k of memory
>to store itself in. But what about big *one, etc? Do they also
>take up 40k of memory, or just enough space to hold an address?
one, two, three are only pointers. They only take up enough space to hold an
address
>
>2) In the one=two=three=&zero line, do the pointers now take up 40k
>of memory each, or just enough to hold an address?
>
>What I really need to know is if you can make many pointers pointing
>to one variable and save memory that way. Thanks in advance.
>
These all point to the same variable. For example, changing *one will also
change zero, *two, and *three
--
amethyst AT pcc-uky DOT campus DOT mci DOT net
The me that you know, he used to have feelings
But the blood has stopped pumping, he is left to decay
http://www.angelfire.com/pages0/amethyst/index.html
- Raw text -