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


Groups > comp.lang.c++ > #11872

Re: Equates or Synonyms?

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Equates or Synonyms?
Date 2011-11-28 12:50 +1300
Message-ID <9jg0mkF4d0U22@mid.individual.net> (permalink)
References <MPG.293c70af3b85a5c09896d0@news.eternal-september.org>

Show all headers | View raw


On 11/28/11 12:07 PM, Mike Copeland wrote:
>     Is there a C/C++ language capability to "equate" or use a synonym for
> an identifier?  I have the following declaration:
>
> struct DEF_STRUCT
> {
>      int      EPace;               // event maximum pace
>      int      TFCount;             // Total Finishers Counts
>      short    ADepth;              // Awards Depth
>      short    SFMales, SFFemales;  // Skipped Finishers
>      unsigned short dbeMales, dbeFemales;
>      unsigned short finMales, finFemales;
>      unsigned short prtMales, prtFemales;
>      float    EDist;               // event distance in miles
> [etc.]
> } ;
>
> and I'd like to "reuse" some of the names (such as EPace or ADepth) with
> different identifiers.  That is, in some of my programs where I have
> this structure declared I'd like to use a different name for, say,
> EPace, because I'm not actually using that data element in that
> particular application.

A different name for EPace, or a different type?

If the latter, use a typedef in place of int for the type.

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 16:07 -0700
  Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-28 12:50 +1300
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 21:21 -0700
  Re: Equates or Synonyms? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-28 02:41 +0100
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 21:19 -0700
      Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-28 17:35 +1300
        Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 16:03 -0700
          Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-29 12:52 +1300
            Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 22:00 -0700
              Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-29 18:13 +1300
              Re: Equates or Synonyms? ralph <nt_consulting64@yahoo.net> - 2011-11-28 23:21 -0600
              Re: Equates or Synonyms? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-29 12:10 +0000
      Re: Equates or Synonyms? Paavo Helde <myfirstname@osa.pri.ee> - 2011-11-28 01:40 -0600
      Re: Equates or Synonyms? Stuart Redmann <DerTopper@web.de> - 2011-11-28 02:38 -0800
    Re: Equates or Synonyms? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-28 13:24 +0000
  Re: Equates or Synonyms? "Paul" <pchrist<nospam>or@yahoo.co.uk> - 2011-11-28 19:21 +0000
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 16:14 -0700
      Re: Equates or Synonyms? Kalle Olavi Niemitalo <kon@iki.fi> - 2011-11-29 09:01 +0200

csiph-web