delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/16/20:10:39

From: A White <awhite AT user DOT rose DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: enum problem
Date: Mon, 15 Jun 1998 22:03:34 -0500
Organization: Rose Media Incorporated, Canada
Lines: 27
Message-ID: <3585E086.1691@user.rose.com>
References: <bWLoegW7sFse-pn2-0JB8f0w8xHdR AT portX61 DOT lanzen DOT net>
Reply-To: awhite AT user DOT rose DOT com
NNTP-Posting-Host: s01.rose.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Gili wrote:
> 
>         I have the following code:
> "enum listing
> {
>   a=0x00,
>   b=0x02
> };
> 
>  function(listing input)
> {
> }
> "
>         Now, in my main() code I use "function(a|b)" and DJGPP reports that
> my argument should be an "int" not a type "listing".. Which makes no

I'm no expert but I've have a lot of success with:

	typedef enum { a = 0x00, b = 0x02 } listing;

and using 'listing' as a parameter type.

you would (probably) need "function( enum listing input )" for your
current code.

TTFN
A. White

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019