Re: Regarding assignment to struct

Liste des GroupesRevenir à l c 
Sujet : Re: Regarding assignment to struct
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 06. May 2025, 10:46:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vvclpd$2lank$2@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 05/05/2025 22:53, Keith Thompson wrote:
Muttley@dastardlyhq.com writes:
[...]
If you twant o pass an actual array to a function instead of a pointer to it,
embedding it in a structure is the only way to do it.
 Yes, but that's not necessarily useful.  An array that's a member
of a struct can only be of a constant length (unless it's a flexible
array member, but that doesn't help).  Functions that work with
arrays typically need to deal with arrays of arbitrary length.
 
I regularly use arrays with known fixed sizes.  In fact, in my code those are absolutely dominant - it is very rare for me to see or use an array whose size is /not/ fixed at compile time.  Sometimes I will have general functions that take parameters that are arrays of arbitrary length, but not often.
So this is very much dependent on the kind of code you are working with, and other people will have very different experiences for their own code.
However, I think it is not unlikely that people will see use of structs like :
struct vector4int { int vs[4]; };

Date Sujet#  Auteur
2 May 25 * Regarding assignment to struct98Lew Pitcher
2 May 25 +- Re: Regarding assignment to struct1Keith Thompson
2 May 25 +* Re: Regarding assignment to struct13Barry Schwarz
2 May 25 i`* That depends... (Was: Regarding assignment to struct)12Kenny McCormack
3 May 25 i `* Re: That depends... (Was: Regarding assignment to struct)11Lew Pitcher
3 May 25 i  +- Re: That depends... (Was: Regarding assignment to struct)1Lawrence D'Oliveiro
3 May 25 i  +- Re: That depends... (Was: Regarding assignment to struct)1Janis Papanagnou
3 May 25 i  +* Re: That depends... (Was: Regarding assignment to struct)5Kaz Kylheku
3 May 25 i  i+* Re: That depends... (Was: Regarding assignment to struct)3Kaz Kylheku
5 May 25 i  ii`* Re: That depends... (Was: Regarding assignment to struct)2Janis Papanagnou
5 May 25 i  ii `- Re: That depends... (Was: Regarding assignment to struct)1Kaz Kylheku
4 May 25 i  i`- Re: That depends... (Was: Regarding assignment to struct)1Tim Rentsch
3 May 25 i  +- Re: That depends... (Was: Regarding assignment to struct)1James Kuyper
4 May 25 i  `* Re: That depends... (Was: Regarding assignment to struct)2Tim Rentsch
4 May 25 i   `- Re: That depends... (Was: Regarding assignment to struct)1Lew Pitcher
2 May 25 +* Re: Regarding assignment to struct2Waldek Hebisch
3 May 25 i`- Re: Regarding assignment to struct1Lew Pitcher
3 May 25 +* Re: Regarding assignment to struct65Andrey Tarasevich
3 May 25 i+* Re: Regarding assignment to struct9Lawrence D'Oliveiro
4 May 25 ii`* Re: Regarding assignment to struct8Keith Thompson
4 May 25 ii `* Re: Regarding assignment to struct7James Kuyper
4 May 25 ii  +- Re: Regarding assignment to struct1Kenny McCormack
4 May 25 ii  +- Re: Regarding assignment to struct1David Brown
4 May 25 ii  `* Re: Regarding assignment to struct4Keith Thompson
5 May 25 ii   +- Re: Regarding assignment to struct1James Kuyper
5 May 25 ii   +- Re: Regarding assignment to struct1Keith Thompson
6 May 25 ii   `- Re: Regarding assignment to struct1Tim Rentsch
3 May 25 i+- Re: Regarding assignment to struct1Lawrence D'Oliveiro
4 May 25 i`* Re: Regarding assignment to struct54Tim Rentsch
5 May 25 i `* Re: Regarding assignment to struct53Andrey Tarasevich
5 May 25 i  +* Re: Regarding assignment to struct28Michael S
5 May 25 i  i+* Re: Regarding assignment to struct26Andrey Tarasevich
5 May 25 i  ii`* Re: Regarding assignment to struct25Michael S
5 May 25 i  ii +- Re: Regarding assignment to struct1Tim Rentsch
5 May 25 i  ii `* Re: Regarding assignment to struct23Andrey Tarasevich
5 May 25 i  ii  +* Re: Regarding assignment to struct4Michael S
6 May 25 i  ii  i+- Re: Regarding assignment to struct1Tim Rentsch
29 May13:11 i  ii  i+- Re: Regarding assignment to struct1Andrey Tarasevich
29 May17:57 i  ii  i`- Re: Regarding assignment to struct1James Kuyper
5 May 25 i  ii  `* Re: Regarding assignment to struct18Keith Thompson
6 May 25 i  ii   +* Re: Regarding assignment to struct2Tim Rentsch
6 May 25 i  ii   i`- Re: Regarding assignment to struct1Keith Thompson
6 May 25 i  ii   +* Re: Regarding assignment to struct3David Brown
29 May13:19 i  ii   i`* Re: Regarding assignment to struct2Andrey Tarasevich
29 May20:05 i  ii   i `- Re: Regarding assignment to struct1David Brown
6 May 25 i  ii   +* Re: Regarding assignment to struct10Waldek Hebisch
6 May 25 i  ii   i+* Re: Regarding assignment to struct6David Brown
7 May 25 i  ii   ii`* Re: Regarding assignment to struct5David Brown
29 May13:49 i  ii   ii `* Re: Regarding assignment to struct4Andrey Tarasevich
29 May15:33 i  ii   ii  +- Re: Regarding assignment to struct1Janis Papanagnou
29 May20:20 i  ii   ii  `* Re: Regarding assignment to struct2David Brown
29 May22:54 i  ii   ii   `- Re: Regarding assignment to struct1Keith Thompson
6 May 25 i  ii   i+- Re: Regarding assignment to struct1Keith Thompson
29 May13:21 i  ii   i`* Re: Regarding assignment to struct2Andrey Tarasevich
29 May15:43 i  ii   i `- Re: Regarding assignment to struct1Janis Papanagnou
29 May13:14 i  ii   `* Re: Regarding assignment to struct2Andrey Tarasevich
29 May21:56 i  ii    `- Re: Regarding assignment to struct1Keith Thompson
5 May 25 i  i`- Re: Regarding assignment to struct1Tim Rentsch
5 May 25 i  +* Re: Regarding assignment to struct4Keith Thompson
5 May 25 i  i`* Re: Regarding assignment to struct3Andrey Tarasevich
8 May 25 i  i `* Re: Regarding assignment to struct2Tim Rentsch
8 May 25 i  i  `- Re: Regarding assignment to struct1David Brown
5 May 25 i  +* Re: Regarding assignment to struct17Keith Thompson
5 May 25 i  i+* Re: Regarding assignment to struct6Michael S
5 May 25 i  ii+- Re: Regarding assignment to struct1Kenny McCormack
5 May 25 i  ii+* Re: Regarding assignment to struct3Keith Thompson
5 May 25 i  iii`* Re: Regarding assignment to struct2Kaz Kylheku
6 May 25 i  iii `- Re: Regarding assignment to struct1Tim Rentsch
6 May 25 i  ii`- Re: Regarding assignment to struct1Tim Rentsch
5 May 25 i  i`* Re: Regarding assignment to struct10Tim Rentsch
5 May 25 i  i `* Re: Regarding assignment to struct9Keith Thompson
6 May 25 i  i  +* Re: Regarding assignment to struct6Nick Bowler
6 May 25 i  i  i`* Re: Regarding assignment to struct5Keith Thompson
7 May 25 i  i  i `* Re: Regarding assignment to struct4Nick Bowler
7 May 25 i  i  i  +* Re: Regarding assignment to struct2Keith Thompson
8 May 25 i  i  i  i`- Re: Regarding assignment to struct1Nick Bowler
8 May 25 i  i  i  `- Re: Regarding assignment to struct1Tim Rentsch
29 May13:36 i  i  `* Re: Regarding assignment to struct2Andrey Tarasevich
29 May22:36 i  i   `- Re: Regarding assignment to struct1Keith Thompson
5 May 25 i  +* Re: Regarding assignment to struct2Tim Rentsch
5 May 25 i  i`- Re: Regarding assignment to struct1David Brown
12 May 25 i  `- Re: Regarding assignment to struct1NotAorB
3 May 25 +* Re: Regarding assignment to struct8David Brown
5 May 25 i`* Re: Regarding assignment to struct7Muttley
5 May 25 i +- Re: Regarding assignment to struct1David Brown
5 May 25 i `* Re: Regarding assignment to struct5Keith Thompson
6 May 25 i  +- Re: Regarding assignment to struct1Muttley
6 May 25 i  +* Re: Regarding assignment to struct2David Brown
6 May 25 i  i`- Re: Regarding assignment to struct1Muttley
6 May 25 i  `- Re: Regarding assignment to struct1Michael S
4 May 25 +* Re: Regarding assignment to struct6Richard Damon
4 May 25 i`* Re: Regarding assignment to struct5Michael S
4 May 25 i +* Re: Regarding assignment to struct2Lawrence D'Oliveiro
4 May 25 i i`- Re: Regarding assignment to struct1David Brown
6 May 25 i +- Re: Regarding assignment to struct1Tim Rentsch
12 May 25 i `- Re: Regarding assignment to struct1Rosario19
4 May 25 +- Re: Regarding assignment to struct1Tim Rentsch
4 May 25 `- Re: Regarding assignment to struct1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal