Article View: csu.cs.200
Article #214Re: Assignment 5 bool?
From: Trey Herschede
Date: Wed, 25 Mar 1998 00:00
Date: Wed, 25 Mar 1998 00:00
40 lines
1975 bytes
1975 bytes
I defined mine just as Mary did, I hope that there was nothing more to it . . . Trey Xylen wrote: > > donald johnson wrote in message <6f3irg$3n90@yuma.ACNS.ColoState.EDU>... > >This is begining to bug me. The assignment states that we > >should create functions that return type bool with values > >of TRUE and FALSE. Well, apparently the CC compiler doesn't > >know of type bool, so no problem if we create enum that > >defines it, but... this might cause a conflict with a > >complier that did have bool, the book implies that such a > >complier would expect bool with lowercase values of true and > >false (as opposed to all caps). > > > >The book has sort of a way around this (APPENDIX E), which > >still is going to conflict with assignment specs because it > >uses lowercase true and false. > > > >I have chosen to use a variation of Van's example in class > >which used Bool with True, False. My variation uses Bool > >with FALSE, TRUE - close to assignment, but not quite. > > > >Am I missing something here, (often likely) or was the > >assignment mis-printed (possible, I suppose). > > > >Or... was this just an incidental part of the assignment > >and any old kludge will do? -I doubt it, but worth a : ) > > I used the following, and it works just fine, so maybe any old Kludge will > work. :) > > #define bool int > #define false 0 > #define true 1 > > Mary
Technical Details
Message-ID:
<35194520.C0B89F3B@lamar.colostate.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6f3irg$3n90@yuma.ACNS.ColoState.EDU> <6f3jfu$44u6@yuma.ACNS.ColoState.EDU>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 127144,2d515ec67e52407 X-Google-Attributes: gid127144,public From: Trey Herschede <treyh@lamar.colostate.edu> Subject: Re: Assignment 5 bool? Date: 1998/03/25 Message-ID: <35194520.C0B89F3B@lamar.colostate.edu> X-Deja-AN: 337597178 Content-Transfer-Encoding: 7bit References: <6f3irg$3n90@yuma.ACNS.ColoState.EDU> <6f3jfu$44u6@yuma.ACNS.ColoState.EDU> Content-Type: text/plain; charset=us-ascii Organization: Colorado State University Mime-Version: 1.0 Newsgroups: csu.cs.200