X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Thomas Tutone" Newsgroups: comp.os.msdos.djgpp References: <7b68d58f DOT 0401150929 DOT c3117c3 AT posting DOT google DOT com> Subject: Re: Does DJGPP support binary format for integer constants? Lines: 19 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Sat, 17 Jan 2004 05:07:19 GMT NNTP-Posting-Host: 12.77.124.101 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1074316039 12.77.124.101 (Sat, 17 Jan 2004 05:07:19 GMT) NNTP-Posting-Date: Sat, 17 Jan 2004 05:07:19 GMT Organization: AT&T Worldnet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Gerald K. Dobiasovsky" wrote: > I assume he wants to knmow if there's a way to have > constants in binary format instead of decimal or octal > or hex. If so, I don't think there's a way to to do this directly, but you can fake it using a std::bitset. Josuttis has an example on page 462 of The C++ Standard Library. The problem is that this method does not provide a compile-time constant directly. Instead, you can define a constant at namespace scope (or a static constant inside a function) equal to a bitset().to_ulong(), so it only gets calculated once. Not perfect, but works for many purposes. Best regards, Tom