--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4C00004 Date: 04/06/98 From: MARK HOOVER Time: 04:43pm \/To: ROGER SCUDDER (Read 2 times) Subj: reading input from stdin "Bother," said Pooh to Roger Scudder about reading input from stdin. RS> An array is base 0, meaning that the first subscript is 0. Just out of curiosity.....is there anyway to set the array base to base 1? I have no intention of doing this, but I know it can sometimes be done in other languages such as Basic.... CMPQwk 1.42 1960 Mirage Net Lie #6: NetMail is never bounced because of --- MirageNet HQ! * Origin: InnerSpace Mail Systems, Inc. (1:275/104) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4C00005 Date: 04/07/98 From: DARIN MCBRIDE Time: 06:22pm \/To: ALL (Read 2 times) Subj: Fairy Tale Once upon a time, in a kingdom not far from here, a king summoned two of his advisors for a test. He showed them both a shiny metal box with two slots in the top, a control knob, and a lever. "What do you think this is?" One advisor, an engineer, answered first. "It is a toaster," he said. The king asked, "How would you design an embedded computer for it?" The engineer replied, "Using a four-bit microcontroller, I would write a simple program that reads the darkness knob and quantizes its position to one of 16 shades of darkness, from snow white to coal black. The program would use that darkness level as the index to a 16-element table of initial timer values. Then it would turn on the heating elements and start the timer with the initial value selected from the table. At the end of the time delay, it would turn off the heat and pop up the toast. Come back next week, and I'll show you a working prototype." The second advisor, a computer scientist, immediately recognized the danger of such short-sighted thinking. He said, "Toasters don't just turn bread into toast, they are also used to warm frozen waffles. What you see before you is really a breakfast food cooker. As the subjects of your kingdom become more sophisticated, they will demand more capabilities. They will need a breakfast food cooker that can also cook sausage, fry bacon, and make scrambled eggs. A toaster that only makes toast will soon be obsolete. If we don't look to the future, we will have to completely redesign the toaster in just a few years." "With this in mind, we can formulate a more intelligent solution to the problem. First, create a class of breakfast foods. Specialize this class into subclasses: grains, pork, and poultry. The specialization process should be repeated with grains divided into toast, muffins, pancakes, and waffles; pork divided into sausage, links, and bacon; and poultry divided into scrambled eggs, hard-boiled eggs, poached eggs, fried eggs, and various omelet asses." "The ham and cheese omelet class is worth special attention because it must inherit characteristics from the pork, dairy, and poultry classes. Thus, we see that the problem cannot be properly solved without multiple inheritance. At run time, the program must create the proper object and send a message to the object that says, 'Cook yourself.' The semantics of this message depend, of course, on the kind of object, so they have a different meaning to a piece of toast than to scrambled eggs." "Reviewing the process so far, we see that the analysis phase has revealed that the primary requirement is to cook any kind of breakfast food. In the design phase, we have discovered some derived requirements. Specifically, we need an object-oriented language with multiple inheritance. Of course, users don't want the eggs to get cold while the bacon is frying, so concurrent processing is required, too." "We must not forget the user interface. The lever that lowers the food lacks versatility, and the darkness knob is confusing. Users won't buy the product unless it has a user-friendly, graphical interface. When the breakfast cooker is plugged in, users should see a cowboy boot on the screen. Users click on it, and the message 'Booting UNIX v. 8.3' appears on the screen. (UNIX 8.3 should be out by the time the product gets to the market.) Users can pull down a menu and click on the foods they want to cook." "Having made the wise decision of specifying the software first in the design phase, all that remains is to pick an adequate hardware platform for the implementation phase. An Intel Pentium-II, 700 MHz, with 128 MB of memory, a 4.3 GB hard disk, and a 1280x1024 resolution monitor should be sufficient. If you select a multitasking, object oriented language that supports multiple inheritance and has a built-in GUI, writing the program will be a snap. (Imagine the difficulty we would have had if we had foolishly allowed a hardware-first design strategy to lock us into a four-bit microcontroller!)." The king had the computer scientist thrown in the moat, and they all lived happily ever after. --- * Origin: Tanktalus' Tower BBS (1:250/102) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4C00006 Date: 04/07/98 From: DARIN MCBRIDE Time: 06:26pm \/To: PHIL OHL (Read 2 times) Subj: creating objects PO> I know how to make an object the normal way: PO> player player1(); Well, no. That declares a function, returning a player, called player1, that takes no arguements. :-) player player1; PO> but I am trying to create a certain user defined number of objects. PO> Like: PO> cout<<"Number of players "; PO> cin>>n; // in here: player players = new player[n]; // n players. PO> for(x=0; x { PO> cout<<"Player Name "; PO> cin.getline(name,20); PO> /*now i want to create am object here with the name of 'name' but i PO> don't know how*/ Actually, you'll need to use the array, and then have a function to set the name. players[x].setName(name); PO> } Hope this helps! --- * Origin: Tanktalus' Tower BBS (1:250/102) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00000 Date: 04/08/98 From: MARK HOOVER Time: 02:38am \/To: ROGER SCUDDER (Read 3 times) Subj: 32-bit mode "Bother," said Pooh to Roger Scudder about 32-bit mode. RS> I think 4.52 was the last version that supported and created RS> 16bit DOS apps ( thus it is still in demand in this area ). Nope.....5.0 still does them.... RS> I'm not aware of BC++ 5.xx creating 32bit DOS, but I would RS> think it must support Win32 console apps, which are the next RS> best thing (so long as you're running Windows 95). I was thinking more of 32-Bit DPMI apps... CMPQwk 1.42 1960 Mirage Net: We will add your biological and technical s --- MirageNet HQ! * Origin: InnerSpace Mail Systems, Inc. (1:275/104) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00001 Date: 04/08/98 From: MARK HOOVER Time: 02:38am \/To: ROGER SCUDDER (Read 3 times) Subj: Need More Memory "Bother," said Pooh to Roger Scudder about Need More Memory. RS> Don't try to get the whole FidoNet nodelist. It's unlikely that RS> many PC's will have that much resources available. Also, I have RS> noticed that my programs are much more stable when I don't try RS> to load large amounts of data. I didn't have too much of a choice....all the XMS code I got looked too difficult for me to understand... RS> Instead process the nodelist in smaller chunks. Well, it all had with the way I wanted to process it. Figured if the IM nodelist compiler could do it, then I could.... CMPQwk 1.42 1960 Mirage Net Lie #11: I don't match any URA Redneck gline --- MirageNet HQ! * Origin: InnerSpace Mail Systems, Inc. (1:275/104) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00002 Date: 04/05/98 From: TIM HUTZLER Time: 12:33am \/To: DARRELL HNIZDOR (Read 3 times) Subj: Re: Modem DH>I will send asap, let me know if it arrives. DH>by the way on the web: HAYES modem info is available from I think DH>hayes.com. Thanks, I just checked my e-mail. If I don't here from you in a week, I'll look them up. ___ Blue Wave/QWK v2.12 --- Maximus/2 3.01 * Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00003 Date: 04/05/98 From: TIM HUTZLER Time: 12:41am \/To: MARK HOOVER (Read 3 times) Subj: Re: Need More Memory TH>TH>The "real" memory model limits *any* arrays to 65536 bytes. TH>TH>You will have to use 32-bit addressing. TH>MH>How would I accomplish this? Keep in mind, I'm compiling a DOS TH>MH>executable.... TH>That's not a problem. Also, you might consider a 'virtual' heap. MH>You're going over my head here with both your ideas.....:) Oops, sorry... There are some 32-bit compilers for DOS out there: Watcom for one. You can compile flat-model code for DOS. The "virtual" heap is a replacement for "new" and "delete" that makes use of XMS, EMS, or disk space to store large amounts of data. Mind you, any one array is still limited to 65K. But, if you are creating nodes under this size, that that's not a problem. TH>You wrote 70% of the program, and *now* you discover that you can't TH>RAM 200k! Bummer!!! [grin] MH>Didn't think about it at the time....:) Design, design, DESIGN, my friend. Always plan your attack, and you'll never get caught with your pointers down. [grin] TH>Just what are you try'n to do? MH>Trying to read in nodelist.* ??? How do you *read-in* a node list? Nodes are the stuff heaps are made of. Are you reading a file and creating a linked list? This file "nodelist"... what's in it? ___ Blue Wave/QWK v2.12 --- Maximus/2 3.01 * Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00004 Date: 04/05/98 From: TIM HUTZLER Time: 04:50pm \/To: DARIN MCBRIDE (Read 3 times) Subj: Re: overloaded[][] TH>I want to overload the '[' to facillitate 2-dimentional arrays, ie. DM>It's actually the [] operator, but... Yes, I know. But the '[' is the active ingriedent. TH>thisVal = table[x][y]; TH>Since 'table' is dynamically allocated, stactic subscripting does not TH>work here. Overloading a single subscript is easy, but two...??? DM>You basically need to have a class that holds arrays of pointers. This is the way they showed us in school, but I don't think that is an effient implementation. DM>table[x] will be a pointer to table_type. Which will be a DM>single-subscript array. So if you seperate this: DM>table_type* t = table[x]; DM>thisVal = t[y]; DM>You can see this works. So, get rid of the temp var 't'. Hmm. Didn't work... Maybe you can post a complete example? ___ Blue Wave/QWK v2.12 --- Maximus/2 3.01 * Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00005 Date: 04/05/98 From: NEIL HELLER Time: 03:21pm \/To: DARIN MCBRIDE (Read 3 times) Subj: 32-BIT MODE DM> believe that Borland requires an extention to create 32-bit DOS DM> executables.... but we should leave this up to the Borland wizards DM> (any left here?). Just a simple question... Why would someone WANT to write a 32-bit DOS app.. Is there a 32-bit flavor of DOS out there? * KWQ/2 1.2i * --- FLAME v1.1 * Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F4E00006 Date: 04/07/98 From: MATTHEW CLARK Time: 08:12pm \/To: ALL (Read 3 times) Subj: BC++ v5.0 Hello all, i just bought a copy of borland c++ version 5.0 and I have a question or two. Keep in mind that this is an upgrade from Trubo C++ 4.5 for windows 3.1 If I would make a simply console program that simply outputted some results, as I often need to do in my C++ class, Turbo C++ would compile the program into a console app that would run, terminate, and remain on the screen inactivly until I closed it. With BC5, the app closes as soon as it teminates, so I do not get a change to see my output. I can of course add an pause at the end of the program, but then I have to remove it before turning in my program. Is there a way to get BC5 to leave the window on the screen when the program terminates? A second question, I noticed that it now makes simple console programs into DOS programs instead of windows programs, this is great, but is there a way to have the program ran in full-screen mode? I know that I can later run the executable in full screen mode, but what about when BC5 runs it? Anyway, the second question is not that important, I am mainly looking for a way to have BC5 automatically leave the window on the screen as it did with trubo C++ 4.5 (win) thanks for any responses. --- FMail/386 1.02 * Origin: KastlerocK + Jeannette, PA + 412.527.3749 (1:129/230)