delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/01/22:54:06

From: "JoeGuy" <geez AT usxchange DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Errors using Bit Fields in DJGPP
Date: Wed, 1 Mar 2000 20:19:07 -0600
Organization: Posted via Supernews, http://www.supernews.com
Lines: 17
Message-ID: <sbrjrfb8ee6135@corp.supernews.com>
X-Complaints-To: newsabuse AT supernews DOT com
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Are bit fields possible in DJGPP? I tried the following code and got erros:

unsigned getInput():4
{
    unsigned up : 1 = key[KEY_UP];
    unsigned left : 1 = key[KEY_LEFT];
    unsigned right : 1 = key[KEY_RIGHT];
    unsigned down : 1 = key[KEY_DOWN];

Notice I've tried to return a bit field also, but all get errors:
"Base initializer not allowed for non-member functions"   <---Function
signature
"Parse error before ':' " <------Up down left and right

Newbie.


- Raw text -


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