Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: How to compile several C files Date: Tue, 07 Feb 2017 12:22:41 -0800 Organization: None to speak of Lines: 30 Message-ID: References: <87r33aar1x.fsf@bsb.me.uk> <2e38b49e-cca5-499c-b5f7-6d7667616bbd@googlegroups.com> <8e7352bf-8611-3f4f-8fdf-21800e512708@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="04056ce4c9c7dd85ee7ce897aab9f52a"; logging-data="23918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19odXHXfGhZMIP7dxL5Lu7D" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:HJhkCM3E/ub835vdyyEX6t4Md0M= sha1:n7QkbcMVlFvT/eeT3GPJrRBy3Zc= Xref: csiph.com comp.lang.c:103416 Richard Heathfield writes: > On 07/02/17 18:05, Alla _ wrote: > > > >> Now I have only one header, and one .c file. Splitting turned >> out to be not such a pleasant task given the need for both >> .c files to access same structures, thus creating the need >> for global objects, > > No no no no NO! It does /not/ create such a need. The structure /types/ > can be shared (which is one major reason we have headers). The /objects/ > can be passed around as parameters. > > Nevertheless: I think you've made a good decision. Multiple-file > projects can wait until you have more time available to learn how to do > them properly. The word "structure" should be treated as an adjective, not a noun. You can have a structure object or a structure type. If you say you need to access the same structures, it's not clear which one you're talking about. The same applies to "array", "pointer", et al. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"