--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2L00001 Date: 02/16/98 From: ADAM MAJER Time: 03:37pm \/To: ALEXANDER SEMENETS (Read 3 times) Subj: Help! AS>######### AS># ###, # All! AS>######## ## ######### ###p##, ## ######## #p######. Please rewrite your message in English - I'm afraid I can't help you otherwise. * SLMR 2.1a * This tagline stolen by Silly Little Mail Reader! --- FMail 0.92 * Origin: The Programmer's Oasis on FIDONET! (1:348/203) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2L00002 Date: 02/11/98 From: BILL GODFREY Time: 12:40pm \/To: PETER GARNER (Read 3 times) Subj: Moderator Elections PG> I would like to vote for Jonathan de Boyne Pollard as moderator. I PG> would also like to encourage you to relax your rule regarding the need PG> for an internet email address. I think that you have done an excellent Just a quick point, would having a fidonet.org address count? --- Spot 1.3a Unregistered * Origin: (2:2500/702.25@FidoNet) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2L00003 Date: 02/11/98 From: BILL GODFREY Time: 01:10pm \/To: BRIAN WOOD (Read 3 times) Subj: more questions about new BW> Good point, I just used a quick example. My real question was about BW> whether this would raise any objections, or if there's a better way to BW> get the job done. I was confused about the way pointers were passed to BW> a function, and I still am to be honest about it!! :-) Before I start, I'll just say that I came into this half way through. I'm catching up on what has been quoted here. It looks like someone wants to do a realloc with a pointer returned by new. If I'm wrong, I'll plead forgiveness in advance. In the case of strings, you might be better off using a string class, escpecially if it has convertion member functions to and from const char*, which come into play without you having to think about it. If you know and are very sure indeed that new and delete map onto malloc() and free(), and does no extra activity, (except maybe a throw), then you could use realloc() itself. There are various objections to this, which I'm sure some helpfu bunny will leap in and point out. The quoted function will not copy the old contents. If this is not required, then that's fine and dandy, but if you want to copy realloc(), then you would need to do this. I haven't tested it, and I'm sure I've missed a few things. char* new_realloc(char*oldblk, size_t newsize) { char *newblk=new char[newsize+1]; if (newblk != NULL) { strncpy(newblk,oldblk,newsize); newblk[newsize]='\0'; delete []oldblk; } return newblk; } This assumes a character string, and that the contents of the "oldblk" string is a null-terminated string. If you want a realloc() for any type of data, which can include null characters in the middle, then you could usethis slightly dodgy function. void* new_realloc(char *oldblk, size_t newsize) { void *newblk=(void*)new char[newsize]; if (newblk != NULL) { memmove(newblk,oldblk,newsize); delete []oldblk; } return newblk; } It's dodgy, because if you are expanding a block, you will be copying from out of oldblk's bounds. If you don't have any MMU checks on memory bounds, you might be okay. Alteratively, if you know of a way to obtain a new'd block's size, in a function which for no good reason I'll call GetChunkSize(), replace the memmove call with... memmove(newblk,oldblk,min(newsize,GetChunkSize(oldblk)); with an extra function inline size_t min(size_t a, size_t b) { return (a> The lack of a test for NULL on the delete is troublesome, BW> I have never heard of testing the results of delete, I thought it BW> returned void??? I have been checking new allocations though... KK might have meant the pszP parameter is not checked. I don't know. --- Spot 1.3a Unregistered * Origin: (2:2500/702.25@FidoNet) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2L00004 Date: 02/17/98 From: BOB STOUT Time: 12:06am \/To: ANTHONY TIBBS (Read 3 times) Subj: Re: Bordland compiler? On , Anthony Tibbs (1:163/215.38@fidonet) wrote: > No, I don't have DJGPP, nor do I have access to the internet to get DJGPP. It's available on the Simtel CD-ROM - somewhere around $20. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2M00000 Date: 02/15/98 From: TIM HUTZLER Time: 07:10pm \/To: ANTHONY TIBBS (Read 3 times) Subj: Re: My Borland 3.0... TH>My borland 3.0 lost its ability to link with any 'iostream' objects. AT>What error, exactly, are you getting? AT>On my TC++ 3.0 disks, there are several .ZIP files which can be AT>extracted with UNZIP.EXE. Just find the appropriate memory model and AT>use that.. AT>Take care, AT>Anthony Thanks, Anthony. ___ 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: F2M00001 Date: 02/14/98 From: JAMIE KOWINSKY Time: 12:26am \/To: BOB STOUT (Read 3 times) Subj: Enviorment variables *** Quoting Bob Stout to Jamie Kowinsky dated 02-09-98 *** > Have you checked out David Nugent's string class in SNIPPETS? *** yes I have... and for some reason I have had no luck getting it to compile.. it looks rather amazing, I just wish I could get it to work... I'll have to try to compile again, but from what I remeber I was getting some kind of 'duplicate definiation' or something for all the str:: defs. I'll try compiling and give more specfics, or perhaps you might know a trick. l8tr -Jamie ... I wouldn't give up Desqview for all the icons in the world. --- FMail/386 1.02 * Origin: KastlerocK + Jeannette, PA + 412.527.3749 (1:129/230) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2M00002 Date: 02/17/98 From: BRADLEY MACOMBER Time: 07:13am \/To: ALL (Read 3 times) Subj: IPX advice I need to talk to someone who has actually implemented communications via IPX packets. The specs I have are good, but I am unsure of what strategy I should use in implementation.. What I want to know is: Does the IPX driver have its own buffer for i/o, meaning that I can have my program read and rite packets at my leisure? or do I have to read packets ASAP (like with the serial ports), because if my program doesn't read them immediately, they ould be overwritten by a subsequent packet...? --- T.A.G. 2.7c Standard * Origin: The Wizards Realm BBS 1-713-946-7315 1:106/7315 (1:106/7315) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2M00003 Date: 02/14/98 From: ROGER SCUDDER Time: 11:31am \/To: DARIN MCBRIDE (Read 3 times) Subj: Not so sloppy after all Hello Darin. 10 Feb 98 19:56, Darin McBride wrote to Roger Scudder: RS>> Hmmm... I find it fascinating the way some of the rules have been RS>> changed. The concept of constructors and destructors does feel RS>> natural and right to me. I seem to need to examine each thing that RS>> I have learned about procedural programming and apply it to C++ DM> ^^^^^^^^^^^^^^^^^^^^^^ RS>> to find out what is different.... what works and what does not. DM> Wrong answer, Roger. ;-) C++ is an an OBJECT-ORIENTED programming DM> language. (Technically, purists claim it isn't that OO, but it does DM> endeavor to be a realistic OO language - i.e., one that works at a DM> reasonable speed.) Ah Shucks!!! does this mean I don't get the car??? Seriously, I know that C++ is an OO language. I think you misunderstood what I was writing. I mean that I think I can benefit from trying to apply what I know about procedural languages, ie; C, COBOL, BASIC, etc... to C++ and find out what all the differences are... I have gained understanding by making false assertions here. I don't care about my ego or if everyone here thinks I am a complete idiot. As long as I am learning the language I am getting what I came for. DM> Objects are supposed to take care of themselves. You send "messages" to it DM> (call its member functions), but let them handle their details. It's DM> similar to an abstract data type in C, except that you don't need to DM> explicitly "close" the data type. It seems to be very different than C to me. I am slowly gaining an understanding of OOP. I have been following a online class and the instructor has us doing things like describing the process of making a cup of coffee. Pre and Post conditions must be described. I guess that is a key part of Abstract Data Types... that each method will have pre and post conditions for the data that it acts upon. What I don't understand, (and I probably will need to read a great deal more before I do) is just what this pure OOP is. It seems to me that OOP is making it's mark all over the programming world... the explosion in JavaScript for instance. -------------/------------- Getting back to the language at hand. What is the difference between a constructor and a copy constructor? -Roger ... A program is used to turn data into error messages --- Msged 4.20 beta 3 * Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA (1:273/404@fidonet) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2M00004 Date: 02/16/98 From: THOMAS HABETS Time: 09:56pm \/To: KURT KUZBA (Read 3 times) Subj: Help with multi-dim chara TH>> ML> DIM K$(100) AS STRING * 256 TH>> Uh, you mean like: TH>> char K[256][100]; KK> That would be K[100][256]; :) Bah! Not my code. I was just asking for details. --- * Origin: Hata alla jvla fanatiker! (2:201/293.22) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F2M00005 Date: 02/17/98 From: KENNY MULLINEX Time: 06:26pm \/To: ALL (Read 3 times) Subj: C++ Where can I get a copy of C++ and for how much? --- ProBoard v2.16 [Reg] * Origin: Bread Board * 972-617-8259 * (1:124/5147)