Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #11093
| From | "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> |
|---|---|
| Newsgroups | comp.programming |
| Subject | Re: when to use a struct(ure) or a class? |
| Date | 2020-07-25 09:16 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <rfgm8r$ude$1@gioia.aioe.org> (permalink) |
| References | <f53949d7-80a0-44ec-a157-ff7a82f31bb8o@googlegroups.com> |
On 25/07/2020 00:06, G G wrote: > when do you choose a structure over a class when the > language supports functions inside of the struct(ure) > definitions? It is difficult to answer without reference to a concrete language. Structure is a construct to create a container type with certain properties, such as static named association of container elements, record aggregates etc. Class is a set of types. Members of the class could be types created as structures. Any type should have a class rooted in the type. Functions do not belong inside anything but compilation modules. E.g. if a function operates on two different classes where would you put it? So basically there should be nothing to choose from. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
when to use a struct(ure) or a class? G G <gdotone@gmail.com> - 2020-07-24 15:06 -0700
Re: when to use a struct(ure) or a class? David Brown <david.brown@hesbynett.no> - 2020-07-25 00:18 +0200
Re: when to use a struct(ure) or a class? G G <gdotone@gmail.com> - 2020-07-24 15:29 -0700
Re: when to use a struct(ure) or a class? David Brown <david.brown@hesbynett.no> - 2020-07-25 00:52 +0200
Re: when to use a struct(ure) or a class? Öö Tiib <ootiib@hot.ee> - 2020-07-25 15:31 -0700
Re: when to use a struct(ure) or a class? Julio Di Egidio <julio@diegidio.name> - 2020-07-26 02:11 -0700
Re: when to use a struct(ure) or a class? Öö Tiib <ootiib@hot.ee> - 2020-07-27 08:37 -0700
Re: when to use a struct(ure) or a class? Julio Di Egidio <julio@diegidio.name> - 2020-07-25 00:02 -0700
Re: when to use a struct(ure) or a class? "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2020-07-25 09:16 +0200
Re: when to use a struct(ure) or a class? Julio Di Egidio <julio@diegidio.name> - 2020-07-25 00:30 -0700
csiph-web