Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Questions Regarding Null and Casting |
| Date | 2011-06-06 20:11 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <isjqbv$olf$1@dont-email.me> (permalink) |
| References | <isbl3d$lvh$1@speranza.aioe.org> |
On 6/3/2011 4:52 PM, BigChuck19 wrote:
> My final question concerns the use of NULL with a structure.
> If I define a structure, say,
>
> typedef struct house {
> int floors;
> char owner[MAXSIZE];
>
> } House;
>
> and then declare h to be a variable of type house
>
> House h;
>
> Now does
>
> h = (House) NULL;
>
> have any meaning?? If so, what does the statement do?
> Thanks for your help
A 'struct' is an "aggregate type" but 'NULL' must be a "scalar type", so
no. This restriction doesn't have anything to do with 'NULL'. The
type-name in a cast must be a scalar type, no matter the value being cast.
Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread
Questions Regarding Null and Casting BigChuck19 <bc19@mailinator.com> - 2011-06-03 21:52 +0000
Re: Questions Regarding Null and Casting Ian Collins <ian-news@hotmail.com> - 2011-06-04 10:13 +1200
Re: Questions Regarding Null and Casting Ian Collins <ian-news@hotmail.com> - 2011-06-04 10:16 +1200
Re: Questions Regarding Null and Casting Keith Thompson <kst-u@mib.org> - 2011-06-03 15:25 -0700
Re: Questions Regarding Null and Casting Tim Rentsch <txr@alumni.caltech.edu> - 2011-06-03 20:45 -0700
Re: Questions Regarding Null and Casting pete <pfiland@mindspring.com> - 2011-06-03 18:38 -0400
Re: Questions Regarding Null and Casting Angel <angel+news@spamcop.net> - 2011-06-03 23:23 +0000
Re: Questions Regarding Null and Casting Keith Thompson <kst-u@mib.org> - 2011-06-03 17:24 -0700
Re: Questions Regarding Null and Casting "J. J. Farrell" <jjf@bcs.org.uk> - 2011-06-04 00:45 +0100
Re: Questions Regarding Null and Casting Keith Thompson <kst-u@mib.org> - 2011-06-03 17:27 -0700
Re: Questions Regarding Null and Casting pete <pfiland@mindspring.com> - 2011-06-03 21:12 -0400
Re: Questions Regarding Null and Casting Shao Miller <sha0.miller@gmail.com> - 2011-06-06 20:11 -0500
csiph-web