![]() |
Structure
Do you need to allocate a structure before you use it if it only holds
one instance and is not in array format? |
Re: Structure
"Jake Thompson" <readytoride39@hotmail.com> wrote in message news:1136778532.615050.165600@g43g2000cwa.googlegr oups.com... > Do you need to allocate a structure before you use it if it only holds > one instance and is not in array format? How could you use it if it isn't declared/defined? |
Re: Structure
Only if it contains a pointer, or anything that takes up memory. If a
struct just has an int or something in it, you don't have to allocate any memory. |
Re: Structure
Jake Thompson wrote:
> Do you need to allocate a structure before you use it if it only holds > one instance and is not in array format? What do you mean by "allocate". Please give an example. Brian -- Please quote enough of the previous message for context. To do so from Google, click "show options" and use the Reply shown in the expanded header. |
Re: Structure
"Benry" <henrybg@gmail.com> writes:
> Only if it contains a pointer, or anything that takes up memory. If a > struct just has an int or something in it, you don't have to allocate > any memory. Context is important; please read <http://cfaj.freeshell.org/google/>. Of course you have to allocate memory for it. You can do so either by calling an allocation function such as malloc(), or by declaring an object (which implicitly allocates memory). -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this. |
Re: Structure
Keith Thompson wrote:
> "Benry" <henrybg@gmail.com> writes: > > Only if it contains a pointer, or anything that takes up memory. If a > > struct just has an int or something in it, you don't have to allocate > > any memory. > > Context is important; please read <http://cfaj.freeshell.org/google/>. Thank you, and I'm sorry! -Ben |
| All times are GMT. The time now is 05:13 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.