Re: Struct assignment
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 20:20:30 +0100
Serve Lau wrote, On 30/06/07 19:53:
"Flash Gordon" <spam@xxxxxxxxxxxxxxxxxx> wrote in message news:hhfil4xnvp.ln2@xxxxxxxxxxxxxxxxxxxxxxxxxxGrey Alien wrote, On 30/06/07 17:43:
<snip>
1). is b.s now ptr to a.s ? (I think so)Since b.s was not defined as a pointer, what makes you think an assignment could magically transform it from being an array in to being a pointer? You need to read section 6 of the comp.lang.c FAQ at http://c-faq.com/ specifically the questions dealing with whether pointers and arrays are the same thing.
Its easy to see where the confusion comes from. There are situations where pointers degenerate into pointers , the OP probably had that in mind
In my opinion it is only easy to confuse arrays and pointers if it is badly taught. If arrays and pointers are taught as fundamentally different concepts and *then* the way array names degenerate to pointers to the first element is explained there will not be anything like the problems. In one-to-one sessions I've been able to explain the basics of arrays pointers to non-computer people in minutes (I needed to so I could explain approximately what was the cause of a problem), although I did not go on to how things are done in C.
--
Flash Gordon
.
- References:
- Struct assignment
- From: Grey Alien
- Re: Struct assignment
- From: Flash Gordon
- Re: Struct assignment
- From: Serve Lau
- Struct assignment
- Prev by Date: Re: Machine epsilon: conclusion
- Next by Date: Re: Machine epsilon: conclusion
- Previous by thread: Re: Struct assignment
- Next by thread: Re: Struct assignment
- Index(es):
Relevant Pages
|