www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/16/14:31:23

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: enum problem
Date: Mon, 15 Jun 1998 08:34:29 -0700
Organization: Alcyone Systems
Lines: 20
Message-ID: <35853F05.36F4E3E7@alcyone.com>
References: <19980615072556700 DOT AAA231 AT portC17 DOT Generation DOT NET>
NNTP-Posting-Host: charmaine.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

sl wrote:

> void saychoice(lineType choice)
> {
>   if (choice|dLine==dLine)
>     printf("double line chosen");
>   if (choice|overwrite==overwrite)
>     printf("overwrite mode chosen");
> }

Well, one problem is this.  You meant bitwise and, not bitwise or. 
These comparisons will only test true if `choice' were zero.

-- 
         Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
                       Alcyone Systems / http://www.alcyone.com/max/
  San Jose, California, United States / icbm:+37.20.07/-121.53.38
                                     \
           She glanced at her watch / . . . It was 9:23.
                                   / James Clavell

- Raw text -


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