home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:18677 comp.std.c:3239
- Path: sparky!uunet!spool.mu.edu!uwm.edu!psuvax1!rutgers!mcdhup!src4src!wozzle!alane
- From: alane@wozzle.linet.org (J. Alan Eldridge)
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: Is this ANSI: final (long)
- Message-ID: <gggZVB1w165w@wozzle.linet.org>
- Date: 18 Dec 92 14:51:27 GMT
- References: <1363@mwtech.UUCP>
- Organization: Disorganization
- Lines: 20
-
- martin@mwtech.UUCP (Martin Weitzel) writes:
-
- > :The point is this: If you are dynamically allocating *both* the
- > :structure and the data, the approach you suggest requires *two*
-
- > Yes, and there's another point: With a single allocation you may
- > memcpy/memmove/memcmp/[f]read/[f]write the whole easily. Each of
- > this would become a specialized operation if you separate the size
- > from the data.
-
- This is illegal in C++ for a good reason, and I find it inadvisable
- in C for similar reasons. For one, structure assignment is broken. For
- two, you are cheating what type safety there is in C. Neither one of
- these results is attractive in my opinion. I vote quite vehemently for
- allocating a separate data area and accessing it through an extra level
- of indirection... if your CPU has problems because of the extra one or
- two instructions that are introduced, buy a real computer.
-
- alane@wozzle.linet.org (J. Alan Eldridge)
- Fido: The University of Walamaloo 1:272/38.473
-