--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00011 Date: 04/17/97 From: ANDERS WEGGE JAKOBSEN Time: 10:25pm \/To: PIERRE PHANEUF (Read 5 times) Subj: Rating of C++ Quoting Pierre Phaneuf to Jerry Coffin, 16 Apr 97 about Rating of C++: JC>> Assuming your compiler works correctly, you get an error message. The JC>> syntax in the draft standard makes it clear that if you have an equal JC>> sign there, only a zero can follow it. Anything else is an "Ill JC>> formed program". PP> This is crazy. Like those so-called "keywords" for casting... Since when PP> am I supposed to see "dynamic_cast" and recognise this as a KEYWORD for PP> chrissake??? Looks like a damn Pascallian variable name! ;-)) One of PP> the suggested "fix" for the "= 0" is to "add" a keyword like this: Where exactly are one supposed to use dynamic_cast? PP> #define abstract = 0 PP> So you just do that: PP> virtual void fn() abstract Personally, I think this way is a kludge which should never have been legal. The same effect is much cleaner obtained by declaring the constructor in the protected: section of the class. MVH, Anders Wegge Jakobsen --- Mail Manager 1.22x/n #1096 * Origin: Sirius Cybernetics * V32.ter * HST16k8 * V.34+ * FAX * 2:238/28.0) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00012 Date: 04/16/97 From: QUINTIN OLIVER Time: 12:19am \/To: KEVIN SHEETZ (Read 5 times) Subj: File accessing... Hello Kevin, Nice to seeya again, if you wan't to access files in Basic here's some stuff: let's say you wan't to open a file called 'name.txt' this is how: OPEN "name.txt" FOR INPUT AS #1 INPUT #1, FIRSTLINE$ CLOSE #1 PRINT FIRSTLINE$ This is how to do it in MS Qbasic I hope you don't wan't it in Visual Basic since I don't program in it. Err how? well this program opens a file called name.txt for INPUT this means the file will be opened for reading data from it, if the file was opened for OUTPUT it means the file opened for data input. The file must exist before it can be opened. There are also other ATT's for opening files like RANDON, etc.. should be in online help or your Qbasic Programmers reference. I hope this works for you, I had to do the code in a hurry but it should ork, email me if you have any problems. Seeya, Quin (short fot Quintin) --- F.I.P.S./32 v0.95 Win95/NT * Origin: Happiness is seeing your boss's face on a milk cartoon (2:250/121.9) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00013 Date: 04/16/97 From: CHRISTOPHER BUTLER Time: 06:11pm \/To: ALL (Read 5 times) Subj: Scroll Lock Hello All! Thanks to the person (or people, if the messages haven't reached me yet ) who replied to my message on getting the scroll lock status. Just one question, how would I change the status? I'm trying to expand my program that does the "in" and "out", to maybe a util for sysops to remotely toggle it. Christopher E-Mail: chris@db-bbs.coracle.com --- FMail/Win32 1.22 * Origin: Death Butler BBS, +44-1582-620141, 24 Hours (2:257/135) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00014 Date: 04/15/97 From: CRAIG A MCKAY Time: 09:32pm \/To: PAUL C PURGETT (Read 5 times) Subj: Inputting Info Y'ello Paul! 11 Apr 97, All had to endure Paul C Purgett's ramblings (shown below). PCP> I recently purchased Visual C++ 1.0 (Windows). I was wondering PCP> how to enter, say, a sentence, and have the program recall the PCP> sentence. Here's something to chew on: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Simple I/O by Craig A McKay (c) 1997 McMoose Systems * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include const int MAX_BUF = 256 ; int main(void) { char inbuf[MAX_BUF] ; // Buffer space for sentence cout << "Enter sentence: " << flush ; // Ask for input cin.get(inbuf, MAX_BUF, '\n') ; // Get up to MAX_BUF chars // terminated by newline cout << "You typed: " << inbuf << endl << flush ; // Echo text return(1) ; } I suppose, thought, if we're going to call it "C++", we'd better make it Object Oriented and have at least one class... /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * EasyIO by Craig A McKay (c) 1997 McMoose Systems * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include const int MAX_BUF = 256 ; class EasyIO { private: char the_sentence[MAX_BUF] ; // Buffer space for sentence public: EasyIO() { strcpy(the_sentence, "") ; } int getSentence() { // Ask for input cout << "Enter sentence: " << flush ; // Get up to MAX_BUF chars terminated by newline cin.get(the_sentence, MAX_BUF, '\n') ; return ( strlen(the_sentence) ) ; } void putSentence() { cout << "You typed: " << the_sentence << endl << flush ; } } ; int main(void) { EasyIO eio ; if (eio.getSentence() > 0) eio.putSentence() ; return(1) ; } There ya go! Mind you, I've just read your message again... and noticed the VisualC++ part, which means you don't want to know any of my rabid ramblings. I used VC++ 1.0 at work, it's an older version, but perfectly useable. You probably want to take your sentence from a Textbox or something like that do you? If you can cut'n'paste you could try the above provided there's a console or something similar. Hmm. Well, just tryin' to help. :) Fido = 2:259/33 --Craigzilla++ Internet = McMoose@sol.co.uk WWW = http://www.taynet.co.uk/users/mcmoose/ --- GEcho 1.00 * Origin: The Kilted Bun, Letham Angus -- hame o' the McMoose (2:259/33) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00015 Date: 04/15/97 From: CRAIG A MCKAY Time: 09:51pm \/To: KEVIN SHEETZ (Read 5 times) Subj: File handling in BASIC Y'ello Kevin! What do you want to do? If it's just manipulating text files, that's a doddle. If you want to use a structured, random-access file, again, BASIC allows you to do this quite easily, although I would be the first to admit the syntax is cumbersome. Say, for example you wanted to do something like convert one file to all pper case, and save it to another file. (Forgive twee and contrived example) OPEN "file1" FOR INPUT AS 1 OPEN "file2" FOR OUTPUT AS 2 WHILE NOT EOF(1) LINE INPUT #1, l$ PRINT #2, UCASE$(l$) WEND CLOSE END I think BASIC is a fantastic, versatile wee language and because things can e rustled up really quickly, you can a working solution in nae time at a'. I use MS-QuickBASIC 4 all the time. Stream handling in C++ is Ok too, though... I could give you an example similar to the one above if you like. If I'm being condescending and saying stuff that's insulting or far less complex than what you were trying to do, I really am sorry. I get accused of over-simplifying things. I just like to try to explain myself correctly. :) Seeya! Fido = 2:259/33 --Craigzilla++ Internet = McMoose@sol.co.uk WWW = http://www.taynet.co.uk/users/mcmoose/ --- GEcho 1.00 * Origin: The Kilted Bun, Letham Angus -- hame o' the McMoose (2:259/33) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00016 Date: 04/16/97 From: STEVE WESTCOT Time: 05:15pm \/To: QUINTIN OLIVER (Read 5 times) Subj: Hacking into Apps On <12 Apr, 16:29>, Quintin Oliver wrote to Kevin Sheetz : QO> KS> How can a program be reverse engineered? QO> Well first if your serious about doing it then yell need QO> the correct software i've got some decompiler software QO> decompiles EXE and COM files to a C soure and them you can QO> use it in your Prog. Would you like it? I thought decompiling was impossible with C or C++ because of the complexity of variables and the like. I read that in Snippits. Steve Westcot ...Beware of programmers who carry screwdrivers --- FMail 1.0g * Origin: Where It's At BBS, Kimberly, WI (414)788-8050 (1:139/615) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00017 Date: 04/17/97 From: MARKUS DREXELIUS Time: 09:24am \/To: STEPHEN GAGE (Read 5 times) Subj: Re: Random access files Hi! > I've got a spec of how the Hudson message base is stored, but I can't read > the files from the disk! I have a spec similar to the following: > > char* FromName[36]; > char* ToName[36]; > char* Subject[72]; > int origzone; > int destzone; > etc... > > How do I read the n'th chunk from the disk? I'm learning c++ at Uni, but 'm > only a first year, and we've only used the file streams so far... I think I > will probably need to use structs as well, but I have no experience > whatsoever of using these beasts. For example: make use of the streams-capabilities of C++. (I'm using BC++ 4.52, I don't know, if it works with this syntax in visual c++): ---------cut off------------------------------------- ... struct { char* FromName[36]; char* ToName[36]; etc... } msg; fstream f; f.open("file.hds", ios::in | ios::binary); f.seekg( (sizeof(msg) * n - 1)); f.read((unsigned char*)&msg, sizeof(msg)); f.close(); ... ---------------cut off----------------------------------- with n is the number of the message between 1 and max. I think, that the message-text hasn't a fixed size to store it in a structure. If so, you have to open the file like above and to read each message like in a sequentiel file until you reach your searched record... If you've more questions: ask me! :-) Bye, yours Markus --- CrossPoint v3.1 * Origin: (2:244/1661.4) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4N00018 Date: 04/15/97 From: ANDREAS NEUKOETTER Time: 09:19pm \/To: HERMAN SCHONFELD (Read 5 times) Subj: DJGPP optimizations Hi Herman, [...] HS>> If you ask me, djgpp is good at optimizing. NS>> Pretty good is right! Its also great for profiling. Sometime omit NS>> the -s and -fomit-frame-pointer switched, add in -pg (Assuming you NS>> have gprof which comes with DJGPP) and execute your program. This NS>> will kick out a dump to a file, then run gprof | NS>> more or redirect output to a file, and you can see all kinds of NS>> stuff, how many times a function is executed, how long it took, NS>> etc, alot better then the big beastly confusing Turbo Profiler if NS>> you ask me. HS> It doesn't seem to work. When i try running "gprof tex.exe | more" it HS> returns with an error message "unrecognized file format". Have you run the Program once before (!!!) you tried the gprof ??? HS> I tried running "gprof tex.o |more" and it dumped a whole lot of HS> directives on the screen (as if i were to type gprof /? etc). No !! The o(bjekt)-file is the wrong parameter !!! HS> How do i get this to work? add "-pg" when compiling ... run the program ... start gprof !!! ciao Anti --- * Origin: Airconditioned Area - Please don't open Windows !!! (2:246/1030.2)