--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EFZ00009 Date: 11/28/97 From: JAMIE KOWINSKY Time: 09:42pm \/To: ALL (Read 2 times) Subj: Reading to the end of file What is the prefered loop for reading to the end of a file? while (!filestream.eof()) or while (!filestream.fail()) What is the major difference between the fail() and eof() test? should I perhaps || them together? I experemented with reading a text file and both seamed to give the same results. As alway, any info would be greatly apperaciated. thanks! -Jamie ... Pentiums melt in your PC, not in your hand. --- FMail/386 1.02 * Origin: KastlerocK + Jeannette, PA + 412.527.3749 (1:129/230) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EFZ00010 Date: 11/30/97 From: KURT KUZBA Time: 12:53am \/To: ERIC BRULE (Read 2 times) Subj: couleur EB> je cherche comment mettre un fond de couleur lors de EB> l'execution de mes programmes en c++. EB> Si qqn le sait ecrivez=moi. alp We could be more help in English, please. Personally, I don't know any French. On the other hand, however, the use of color in a program is highly dependent on your hardware platform, OS, and compiler. Was that the question? Given more details, we may be able to help. --- > ] I'm not materialistic. I'm just Object Oriented............. --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EFZ00011 Date: 11/30/97 From: KURT KUZBA Time: 12:53am \/To: FRANK MASINGILL (Read 2 times) Subj: Try blocks FM> The books says that unless my compiler "try" it cannot be FM> compiled. I have Turbo C/C++ 3.0 from Borland. It does FM> not have it. What version would I have to get to have FM> that and how important is it? Just to be certain, type "try" all by itself and see if it shows the same contextual screen attributes as other reserved words in the editor, such as switch or else. The keyword try is used with catch, normally. Remember how we always tested a pointer when using it with malloc() in C? This is similar, where we are using new and delete instead of malloc() and free(). C++ will throw an exception when an allocation fails. You can take advantage of this by using try and catch. try { PlayerClass *Player = new PlayerClass; return Player; } catch { cout << "I'm sorry, There is insufficient memory to\n" "handle an additional players at this time.\n" "Please try again later.\n" << flush; return PlayerClass(NULL); } This allows you to react to an allocation error, just as you would with a malloc(): PlayerClass *Players = malloc(sizeof(PlayerClass)); if(!Players) { printf("Malloc error in Players.\n"); } The idea, of course, is that you have control of the situation when an allocation fails, and are able to do whatever is necessary to either salvage the situation or exit gracefully from your application. I'm sure somebody else can explain it better, and will. :) --- > ] Win'95 :: The Commodore 128 of the Intel World.............. --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EFZ00012 Date: 11/30/97 From: KURT KUZBA Time: 12:53am \/To: ALBERTO MONTEIRO (Read 2 times) Subj: Save Bitmap in M$C AM> AM> I would like to know if there is any function (or AM> AM> whatever) that saves a bitmap to a file. AM> I now have a working routine. Do you want to see it? Yes! One more wheel I won't need to re-invent. :) > ] You want me to stay current? I can barely stay awake!!...... --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EFZ00013 Date: 11/29/97 From: DANIEL TROY Time: 11:34pm \/To: TIM HUTZLER (Read 2 times) Subj: How to make a DOS sc In a message originally to Alex Walker, Tim Hutzler said: TH> 714/970 TH>AW> Hi All TH>AW> Just wondering if anyone had any good ideas where I can find out how TH>AW> to make a DOS screen saver? I'd like to blank the screen and then TH>AW> run a little program I've created to look for Perfect Numbers TH>AW> when ever there's no user input for... well just like a screen TH>AW> saver. TH>AW> Thanks for any ideas or code. C yaz TH> Just curious... What makes a number, 'perfect?' TH> --- Maximus/2 3.01 * Origin: Madman BBS * Chico, California TH> * 530-893-8079 * (1:119/88) when the sum of the divisors (excluding the number itself) is equal to the number eg 6 and 28 are perfect numbers because 6=1+2+3 and 28=1+2+4+7+14 there has also been discovered a link between perfect and prime numbers though i am not exactly sure what that is Life is one hell of a 'malicious woman' --- FMailX32 1.20 * Origin: GAK's BBS; Sydney, Australia; 336oo; +612 9796 2821 (3:712/102) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EG100000 Date: 11/28/97 From: ROSE Time: 11:33pm \/To: ALL (Read 2 times) Subj: Sony Playstation I've heard that it is MetroWorks Codewarrion, which has a C library which allows your code to Work on Sony Playstation.. Is that correct? I'd assume then J++ should be able to do this too, since it's way more platform independent. --- Platinum Xpress/Win/Wildcat5! v2.0 * Origin: Doctor On Board BBS: Niagara's Medical Host for Info (1:247/101) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EG100001 Date: 11/28/97 From: COY YEARWOOD Time: 11:43pm \/To: ALL (Read 2 times) Subj: books does n e one know of a really good C++ book for someone that is going to take the AP class next year and wants to get ahead of the class... is there n e good books out there where the author isn't all hung up on one simple issue of C++??? thanx --- FLAME v1.1 * Origin: 24th Street Exchange * A BBS Since 1983 * 916.448.2483 (1:203/52) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EG100002 Date: 11/30/97 From: DARIN MCBRIDE Time: 02:26am \/To: CHRIS DOWNS (Read 2 times) Subj: Re: Java++ PG> The issue with Microsoft is not their lower prices. Although some PG> competitors would do well to realize that. The issue with Microsoft PG> is that they use extremely dishonest business CD> practices coupled with a PG> very slick legal department and an almost unlimited cash flow to dump PG> very low quality software onto the public. CD> I can see that you're an unbiased observer!! The flaw with the above CD> logic is that Microsoft still operates in an open market. Nobody CD> is forced to buy Microsoft software. And I realize this sounds CD> amazing, but there are millions of consumers who feel that they CD> get the most bang for their buck from MS sw. As a marginally less biased observer, I just need to say: when I bought my new computer, I was forced to "purchase" NT 4.0. I have since upgraded my OS, but the fact remains that MS received a "purchase" (money and a statistic - meaningless by itself, but can be added up quickly) out of someone who did not wish to purchase their software. However, while I find a lot of MS software to be junk, not all of it is. I was fairly impressed by MSVC v4, despite some annoying small problems in its C parser. (Desperately grasping at straws to remain on topic...) MS leveraged DOS to get Windows preloaded. MS leveraged Windows to get other stuff preloaded. MS leveraged all of this (plus lotsa hype) to get Win95 preloaded. MS leveraged Win95 to get IE preloaded. At least according to the DOJ, this is dishonest and illegal. The courts already ruled on it once, and MS is, according to the DOJ, ignoring the ruling. MS, of course, denies this. The courts will determine whether the DOJ or MS are telling the truth (legally speaking anyway). The market is NOT that open. PG> I have seen PG> M$ try to market their software to hospitals where they knew it would PG> literally kill people, and attempt to cover their PG> tracks by hiring the PG> competent people away from them. In fact the PG> latter is a well known M$ PG> tactic. CD> You've gone off the deep end... Divers are not always incorrect. ;-) He is right in one sense - MS does purchase talent (signing bonuses of $50,000 to $5,000,000 US are not unheard of, plus salaries of $100,000+ - if your talent is important enough, you can see 4 or 5 times salary increases over your current job, sometimes more!). I don't know about the hospitals, although personally I'd be rather leary of trusting my money or health to PC-based solutions, whether WinNT or OS/2. The hardware just simply wasn't designed for that type of robustness, and when hardware dies, there ain't anything the software can do about it... [Just last week one person I knew was hired away from my employer due to a price he "couldn't resist"... and he is an os/2 bigot like myself! ] --- Maximus/2 3.01 * Origin: Tanktalus' Tower BBS (1:250/102) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EG100003 Date: 11/29/97 From: CAMERON CLARK Time: 08:17pm \/To: RORY STREET (Read 2 times) Subj: Re: Java++ RS> But to run the Java programs unlike C programs (desperate atemp to stay n RS> topic :)) you need something already running in meme,ory to notice them? A web browser will run a *.class file or you must use a program to run it: eg jview Program.class. The Java OS may run class files without a secondary program. RS> RS> But where is the interpreter kept. Is it in memory all the time? (see above) It's like the old style QBasic programs that need QBasic to run the program - except *.class files are byte code, not source code. --- GEcho 1.00 * Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EG100004 Date: 11/29/97 From: CAMERON CLARK Time: 08:22pm \/To: ALEX WALKER (Read 2 times) Subj: Re: Sorting small arrays? AW> With an array of this size, does it really matter what sort AW> algorithm I use? Wouldn't the dreaded Bubble sort give similar AW> performance to other algorithms, (evne if repeated 100 times)? For small amounts of data, most sort algorithms are the same. As data increases, bubble/selection sort grows exponentially. As data increases, quick/merge sort grows only log base 2 of N. (where N is the number of data items) As data increases, Hashing takes 3 probes (as long as the table is about 20% empty) then hashing will be as productive as a linear sorting algorithm. --- GEcho 1.00 * Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)