Deutsch English Français Italiano |
<vt5ij2$e5qu$3@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: do { quit; } else { } Date: Wed, 9 Apr 2025 11:36:18 +0100 Organization: A noiseless patient Spider Lines: 21 Message-ID: <vt5ij2$e5qu$3@dont-email.me> References: <vspbjh$8dvd$1@dont-email.me> <8634enhcui.fsf@linuxsc.com> <vsph6b$ce6m$5@dont-email.me> <86ldsdfocs.fsf@linuxsc.com> <20250406161323.00005809@yahoo.com> <86ecy5fjin.fsf@linuxsc.com> <20250406190321.000001dc@yahoo.com> <86plhodtsw.fsf@linuxsc.com> <20250407210248.00006457@yahoo.com> <vt15lq$bjs0$3@dont-email.me> <vt2lp6$1qtjd$1@dont-email.me> <vt31m5$2513i$1@dont-email.me> <slrnvvcdpa.jbc.ike@iceland.freeshell.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 09 Apr 2025 12:36:18 +0200 (CEST) Injection-Info: dont-email.me; posting-host="86cd0c292c528f4b59336ead25869004"; logging-data="464734"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6Ku6TAshlmPl4y1QJFSyR" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:EQPz1+YZ52Kd4vLOf9iq4j8uNT0= In-Reply-To: <slrnvvcdpa.jbc.ike@iceland.freeshell.org> Content-Language: en-GB Bytes: 1993 On 09/04/2025 10:00, Ike Naar wrote: > On 2025-04-08, bart <bc@freeuk.com> wrote: >> However if I need to initialise the variable: >> >> extern int table[]; // shared >> int table[] = (10, 20, 30) >> >> then other modules can't pick up length of the array. > > extern int table[3]; That is not practical to do. If it was, you'd just write: int table[3] = (10, 20, 30) instead. But now you need to track the size of the data (it could be 1000s of elements) and keep both bounds updated. The data can also include conditional elements that affect the total.