Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c > #6215

Re: Problems with Parametric Macros

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From Hans-Bernhard Bröker <HBBroeker@t-online.de>
Newsgroups comp.std.c
Subject Re: Problems with Parametric Macros
Date Sun, 7 Feb 2021 21:11:57 +0100
Lines 17
Message-ID <i8avshFs03eU1@mid.dfncis.de> (permalink)
References <db004614-55ee-4b5f-87c8-ed2513358d15n@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.dfncis.de CJvQIw/1R6IVBC+FCKhELwhjJRepJe9viy2WjzUq7xmKWFTVF5zDv/Yyn7
Cancel-Lock sha1:kCesJstO6Iz+B+z/nr0a9JMmn+c=
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0
In-Reply-To <db004614-55ee-4b5f-87c8-ed2513358d15n@googlegroups.com>
Content-Language de-DE
Xref csiph.com comp.std.c:6215

Show key headers only | View raw


Am 07.02.2021 um 18:30 schrieb emanuele cannizzo:
> In my code I have a lot of vectors with a similar name:
> vector1, vector2, vector3, vector4, ...

Don't do that.  As a rule of thumb, whenever you feel the urge to put 
running numbers of things into the name of things, you're almost 
certainly missing out on the obvious solution to make an array out of 
those things, instead, turning that number into an array index.

You want

vectortype vector[10];  // or however many of these you need

Either that, you or you need to get up to speed with pointers to 
"vectortype" things.

Back to comp.std.c | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Problems with Parametric Macros emanuele cannizzo <emacannizzo@gmail.com> - 2021-02-07 09:30 -0800
  Re: Problems with Parametric Macros James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-02-07 13:27 -0500
  Re: Problems with Parametric Macros Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2021-02-07 21:11 +0100

csiph-web