--------------- --------------- const int NumSizes = 3; const int NumTops = 5; const ChoiceDescription const Sizes[NumSizes] = {{"Small", 10}, {"Medium", 12}, {"Large", 14}}; const ChoiceDescription const Tops[NumTops] = {{"Pepperoni",1.8}, {"Sausage",2.1}, {"Onions", 0.5}, {"Extra Cheese",1.0}, {"Olives", 0.7}}; -------------------etc. On the two last "const" lines I am getting the error " 'const' has already been included in function main() " This is all that is preventing the compiling of this program. I tried substituting a comma for the second "const" in each line but that only produced a multitude more errors. Hope you or somebody can help. Sincerely, Frank --- FMail/386 1.02 * Origin: Maybe in 5,000 years frankmas@juno.com (1:396/45.12) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00044 Date: 05/02/97 From: KEVIN CAMPBELL Time: 07:55pm \/To: PETER HAYWOOD (Read 3 times) Subj: MS-DOS Env. > KC> Does anyone know how to inset information into the environment block > You might try the putenv() function. It has the following format: Yeah, but that doesn't change it in the higher-up envirnoment blocks, as I think I said. This will only work for child processes :( Have Fun - Kev Kevin Campbell Sysop of Deimos BBS E-Mail: Sysop@Deimos.unmanned.co.uk --- FMail/386 1.02 * Origin: Mail shipped from Deimos Spaceport (2:259/17) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00045 Date: 05/06/97 From: NIKLAS NYLUND Time: 08:10pm \/To: ALL (Read 3 times) Subj: graphics! Where can i find a good graphics library for borland c++, with full source code, on how to load pictures in vga and svga!?? Could anybody tell me a good ftp/web site or any other place? --- BBBS/2 v3.33 How-D * Origin: Deaf Leopard - +358-6-3207580 - V.34/ISDN - (2:224/0) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00046 Date: 05/05/97 From: DAN CHAK Time: 10:56pm \/To: ALL (Read 3 times) Subj: My queue (1) Hi everyone! I am a beginning C++ programmer, hoping to become a little better. I have begun writing a queue class to use in programs, but am running into some difficulties. I would appreciate it if someone could look at what I've got so far and possibly tell me what's wrong. My compile-time errors are attached at the bottom. ----cut-- // This is "queue.h" template class Queue { private: Queue(); queue* next; static Queue* front; static Queue* back; dataType info; int length; public: Enqueue(dataType Element); dataType Dequeue(); int length(); // template processAll(int (*func)); dataType operator=(dataType op2); }; template Queue::Queue() { next = null; length = 0; } template Queue::Enqueue(dataType Element) { if (length == 0) { front = new dataType; dataType = Element; next = null; } else { *back.next = new dataType; *back.*next = Element; back = *back.next; } ++length; return 1; } template dataType Queue::Dequeue() { if (length == 0) return 0; else { dataType Element = *front; front = *front.next; length--; return Element; } } template operator=(dataType op2) { *this = op2; } template int Queue::length() { return length; } ---cut---- //This is QTest.cpp, my main program file. #include "queue.h" void main() { int i = 1; Queue Q; while (i != 0) do { cout << "Queue (nonZero): "; cin > i; Q.enQueue(i); } while (Q.length() != 0) do cout << Q.dequeue() << endl; } ---cut--- And these are my compiler errors: Error QUEUE.H 49: 'operator =(dataType)' must be a member function Error QTEST.CPP 7: 'Queue::Queue()' is not accessible Any and all comments appreciated!!! --==<<< Continued next message >>>==-- --- OverMail v0.82b * Origin: UXB Info-Serve - BBSList & BFDS FDN Headqtrs (1:141/1135) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00047 Date: 05/05/97 From: DAN CHAK Time: 10:56pm \/To: ALL (Read 3 times) Subj: My queue (2) --==<<< Continued from previous message >>>==-- Thanks, Dan ... Diahhorea is hereditary. It runs in your genes. ___ Blue Wave/QWK v2.12 --- OverMail v0.82b * Origin: UXB Info-Serve - BBSList & BFDS FDN Headqtrs (1:141/1135) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00048 Date: 05/05/97 From: JOSHUA BOEHME Time: 07:03pm \/To: JIM ROBIN (Read 3 times) Subj: Throw of dice While gazing into my crystal ball, I saw a message from Jim Robin to All JR> I've got this friend who is constructing a dice game using Visual C++ JR> where one of the required elements is to simulate the throwing of a JR> dice. JR> To cut a long story short does anyone know of an algorithm that can JR> generate numbers between a lower bound value and an upper bound value JR> - in the case of the dice example 1 - 6. Your compiler should have a function called random() or something similar. (written for Borland Turbo C++) #include #include main() { randomize(); // Resets the random number generator seed using current time int dice_roll = random(6) + 1; // Random(int mod) generates a random value // between 0 and mod-1 } --- FMail 1.02 * Origin: The misty isles of Stonegaia (1:159/600) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00049 Date: 05/06/97 From: CRAIG MCGREGOR Time: 05:48pm \/To: JIM ROBIN (Read 3 times) Subj: Throw of dice Hello Jim! 30 Apr 97 07:14, Jim Robin wrote to All: JR> Hi All, JR> I've got this friend who is constructing a dice game using Visual JR> C++ where one of the required elements is to simulate the JR> throwing of a dice. JR> To cut a long story short does anyone know of an algorithm that JR> can generate numbers between a lower bound value and an upper JR> bound value - in the case of the dice example 1 - 6. The function rand() should produce a "fairly" random number, the problem fter that then is just the number range it uses being much larger than what you want. This is easily solved however by doing a mod on the number, for instance something like: int random(int max) { return (rand() % max) + 1; // Return a number between 1 and max. } main() { .... dice_score = random(6); .... } Regards, Craig email: cmcgregor@clear.net.nz Netmail: "Craig McGregor" 3:772/1175@fidonet.org "Craig McGregor" 8:9000/110@familynet --- GoldED/2 2.42.G0615 * Origin: The Lamp (Christian) BBS, Auckland, New Zealand (3:772/1175) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5B00050 Date: 05/06/97 From: RONALD SCHLEGEL Time: 07:02am \/To: JIM ROBIN (Read 3 times) Subj: BBS Jim, JR> Does anyone know of a BBS that has loads of Borland C++ source code JR> examples? I do! The Dynasty BBS (937)-258-1030 -Ron * RM 1.3 03129 * Just leave this long-haired country boy alone --- TriToss (tm) Professional 11.0 - #229 * Origin: The Dynasty BBS * Home of Crazy Nights Software * (1:110/1065.0)