Xref: utzoo comp.lang.c:36554 comp.software-eng:4929 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!mcsun!hp4nl!media01!pkr From: pkr@media01.UUCP (Peter Kriens) Newsgroups: comp.lang.c,comp.software-eng Subject: Re: Source File Organization Message-ID: <2128@media01.UUCP> Date: 26 Feb 91 22:34:13 GMT References: <1991Feb26.045242.23453@rfengr.com> Reply-To: pkr@media01.UUCP (Peter Kriens) Organization: Mediasystemen, Netherlands Lines: 24 > typedef enum { A, B, C, D } CMD; > and a corresponding array of ascii representations : > char ltrs[] = { 'A', 'B', 'C', 'D' }; ... > The problem is exacerbated by the fact that the CMD enum, > being a typedef, is in a header file that is included in > many places. Since ltrs[] is an instantiated variable, it > *can't* live in the same place. Where should it live? You could place the table in the header file like typedef enum { A, B, C, D ) CMD; #ifdef _CMDDEF_ char ltrs = { 'A', 'B', 'C', 'D' }; #endif This would at least take care of the fact that they are close together which means that the change of noth being updated simulteneous is actually not zero. The only thing you have to do in the source that is allowed to define the table ltrs, is defining _CMDDEF_ before you include the header file Peter Kriens Brought to you by Super Global Mega Corp .com