--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBW00035 Date: 07/26/97 From: DANIEL MCGREGOR Time: 10:05pm \/To: BALOG PAL (Read 3 times) Subj: Sunir ventures into C++ Hello Balog. 24 Jul 97 08:48, Balog Pal wrote to Dan McGregor: DM>> Well classes with member functions aren't as fast to access as DM>> their counterparts in C with only data members. And C++ struct DM>> and class are synonyms. In C a struct can't have functions :) BP> So please decide what you want to compare. Members of structs/classes BP> are accessed in the very same way (and as fast as) in both languages. BP> And speed of member functions can't be compared as they do not exist BP> in C. Allright. Member functions are basically just pointers to a function. IE: drlines::getlines. And I've noticed that the C++ version of my dragon Linez program isn't as fast, or as small as the C version. DM>> No I have never casted away constness. BP> That's easy for people never using tha const keyword. :-> I'll have to say thats true, I usually just do the #define method :) DM>> but heres the classic example: DM>> printf ((char *) M_BINK_BANNER); DM>> I think that was the line. Its from the Dragon Binky source. (My DM>> own pet version of binkleyterm) M_BINK_BANNER was a #define of an DM>> int :( BP> Cool. :) Dut in that case you probably got a "nonportable BP> pointer-conversion" warning. Nope I didn't. Probably because I had all warnings turned off... :( Showed me what I knew :) BP> But what I talked about is different thing. Let's think thah M_** was BP> const unsigned char *. And you want to cast it to char * to use with BP> printf ot similar func taking that type. (char *) cast is really BP> common in those situations, where it's really a bug. And It will go BP> unnoticed as the compiler turns off all warnings converting pointers BP> with an explicit cast like that. That can't be good. At least if you actually use the const keyword on variables :) BP> But if you use reinterpret_cast you will get an error message. BP> That will not allow you cast away cv-qualifyers, just modify the type. Well, I'll have to get a new version of a C++ compiler. Where could I get DJGPP? Daniel --- Whoop-T-Doo v1.00b (In development) * Origin: The Dragons Cave - Sysop Point (1:140/237.2) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBW00036 Date: 07/26/97 From: KEVIN YOCHUM Time: 03:35pm \/To: CHRISTIAN S. PEDERSEN (Read 3 times) Subj: Conversion of pointer. So sayeth the Book of S. Pedersen, "Conversion of pointer.." CSP> Behold, a function which returns a pointer: CSP> int* test() CSP> { CSP> int i=5; CSP> return &i; CSP> } CSP> Why do I get a "Suspicious pointer conversion"-warning ? The functions CSP> using this concept seems to work OK. Should I make them differently. int i was defined locally to the test() function. When you return &i, you're returning a memory location that has been deallocated because the memory taken by i is released back to the OS when the return is called. It seems to work OK because nothing has yet over-written the memory location, but you're not *guaranteed* that something won't over write it when you try to use i. A better, safer, and guaranteed way to do what you're trying to do follows: void test( int i ) { i=5; return; } You're not getting a pointer back, but you could use &i (or whatever the variable name is in the calling function ). -=Kevin=- Fidonet: 1:363/309 TAGnet : 21:320/0 IntraTec: 191:670/0 JAMNet : 75:82/1 BegNet : 44:244/702 SinNet : 18:28/1 Homepage: http://www.commercialweb.com Internet: kyochum@worldramp.net Internet: kevin.yochum%309@satlink.oau.org ... "Forget the Joneses, I keep up with the Simpsons." --- Blue Wave/386 v2.20 * Origin: Forethought BBS -=- Orlando, FL -=- 407-679-6561 (1:363/309) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBW00037 Date: 07/26/97 From: KEVIN YOCHUM Time: 03:13pm \/To: BRENDAN LAMBOURNE (Read 3 times) Subj: Good C++ Compiler So sayeth the Book of Lambourne, "Good C++ Compiler." BL> I would like to know what your recommendations of a good compiler are? That depends. Do you mean just a compiler or an IDE? There's also a number of things that determine "good". If fast is your goal, Borland has the fastest compilers for the PC. Microsoft has huge company backing, market dominance, and almost guaranteed company survival, but unless you're willing to upgrade to the most current version every time one is released, I've tried Borland 5.x, MS 1.5x, MS 4.x, and Symantec. Of those I personally prefer MS 4.x, however I am eagerly awaiting Borland's C++ Builder to arrive at work so I can use it. I was at this year's Borcon & played with it there & was impressed. If I only knew VCL as well as I know MFC :) -=Kevin=- Fidonet: 1:363/309 TAGnet : 21:320/0 IntraTec: 191:670/0 JAMNet : 75:82/1 BegNet : 44:244/702 SinNet : 18:28/1 Homepage: http://www.commercialweb.com Internet: kyochum@worldramp.net Internet: kevin.yochum%309@satlink.oau.org --- Blue Wave/386 v2.20 * Origin: Forethought BBS -=- Orlando, FL -=- 407-679-6561 (1:363/309) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBW00038 Date: 07/26/97 From: KEVIN YOCHUM Time: 03:19pm \/To: WADE CARPENTER (Read 3 times) Subj: How would I... So sayeth the Book of Carpenter, "How would I...." WC> When I enter a directory, it messes it all up and all my WC> char strings get mixed together, like for example my WC> dir2 string will get the end characters of "C:\WINDOWS\SYSTEM" WC> and other strings just plain disappear. Check your character strings to make sure they're long enough to hold the data you're writing into them. It sounds like the driectory name is too long for the string and is overwriting other variables in memory. -=Kevin=- Fidonet: 1:363/309 TAGnet : 21:320/0 IntraTec: 191:670/0 JAMNet : 75:82/1 BegNet : 44:244/702 SinNet : 18:28/1 Homepage: http://www.commercialweb.com Internet: kyochum@worldramp.net Internet: kevin.yochum%309@satlink.oau.org --- Blue Wave/386 v2.20 * Origin: Forethought BBS -=- Orlando, FL -=- 407-679-6561 (1:363/309) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBX00000 Date: 07/26/97 From: CAMERON CLARK Time: 09:06pm \/To: FRANK SWARBRICK (Read 3 times) Subj: Re: Signs of numbers FS> Hmm, I don't know about that. COBOL uses indexed files and they seem to FS> work fine on my DOS machine. Probably more effort for the compiler, FS> but that's what compilers are for, eh? I dunno how it works unless it truely goes to the lowest execution level and bypasses the FAT and allocates clusters on its own. --- GEcho 1.00 * Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBX00001 Date: 07/27/97 From: KEVIN YOCHUM Time: 07:58pm \/To: DAVID TORREZ (Read 3 times) Subj: Been Away! Just caught up! So sayeth the Book of Torrez, "Been Away! Just caught up!." DT> First on that comes to mind is the C++ is evil issues, *.* languages DT> are better than C++. I'll take a look at the site. The bottom line is, however, use the language which best suits the project - not which language is subjectively "best" since one language doesn't suit all work. I'm sure you already know this, being a software professional. DT> Second is Borland C++, speaking Win32 of course. At the recent BorCon DT> (Borland Convention) someone aske about the future of OWL. Borland DT> Rep said something to the tune of this: Small world... I was at BorCon too. It looks like you were at the C++Builder: Meet the C++Builder Team session. We may have been in the same room. Very small world. DT> MY ANALYSIS OF DIANE'S RESPONSE DT> ------------------------------- MY ANALYSIS OF DIANE -------------------- Major babe. :) Looks, brains and she knows C++. DT> I was pleased with Diane's answers--not because she said what I wanted DT> to hear, but because I thought she was as direct as Borland could be DT> about a tricky question. It seems to me that, while Borland DT> will make some effort to support OWL users with their existing code, DT> they have no plans for further development in the OWL code base. DT> If the OWL code base is to receive further development, it will DT> be in the hands of some other company. I think Diane made that as DT> clear as she reasonably could. Personally, I don' think she could have made it any clearer. It was almost as if she were looking for a volunteer to take OWL right there at the conference. DT> In my view, their new stand implies that run-of-the-mill OWL bugs DT> will probably no longer be addressed. Certainly Borland would prefer DT> not to spread their development energy sparsely over two C++ DT> compiler products with many overlapping features. I can speculate DT> that if upcoming releases of the operating system substantially DT> break OWL, Borland will probably want to make some fixes, but DT> otherwise I don't think OWL will get much development from Borland. Especially with the Borland focus on the BCL. Personally, I don't like the idea of C++ Builder building applications which call into Delphi/Object Pascal code, but it looks like I have little choice since it was also made clear that the BCL would not be ported to C++. That's going to hurt Borland in the area of cross platform C++ development. My company currently writes one source code base in C++ which can be used on the PC and several flavors of Unix. We are simply not going to be able to use C++ Builder for any work on that project due to the Object Pascal BCL. DT> Furthermore, Borland is obviously positioning C++Builder as its DT> primary C++ product. In the initial keynote address, a slide that DT> listed the company's products showed C++Builder but not Borland DT> C++. It's significant that the session where Diane Rogers intro- DT> duced some of the C++ engineers was called "Meet the C++Builder DT> Team." There wasn't a "Meet the Borland C++ Team." My impression DT> is that Borland C++ is no longer strategic to Borland, meaning DT> they don't think they can make much money from it now. They're DT> probably right. I also think that if they do a good job in the DT> next release of C++Builder, those of us who are real Borland C++ DT> fans will feel quite comfortable in the new product. Moving DT> to C++Builder is easy for many projects even now. It was my impression that C++ Builder could be called Borland C++ 6, like they were wrapping Builder around the BC++ IDE. I'm forced to use mostly MS products, so I've had little exposure to BC++ 5. DT> Well, even the US Government uses ADA! Not as much as you would think. The company I work for is a defense contractor. We write code in C++, Object Pascal (Delphi), FoxPro, even QuakeC. Out of the 10 or so projects going on at any one time over the three years I've worked at the company, not one has ever been in Ada. What do you think about the IBM AS/400? I noticed that IBM was pushing it, and even Borland was pushing it. That's probably due to expanding their compilers & IDEs to support that machine. As far as I can tell, it's comparable to a high end pentium machine, or a low end mini. -=Kevin=- Fidonet: 1:363/309 TAGnet : 21:320/0 IntraTec: 191:670/0 JAMNet : 75:82/1 BegNet : 44:244/702 SinNet : 18:28/1 Homepage: http://www.commercialweb.com Internet: kyochum@worldramp.net Internet: kevin.yochum%309@satlink.oau.org --- Blue Wave/386 v2.20 * Origin: Forethought BBS -=- Orlando, FL -=- 407-679-6561 (1:363/309) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBX00002 Date: 07/27/97 From: RAJESH DHAWAN Time: 12:14pm \/To: DANNY KEOGH (Read 3 times) Subj: converting sound data Hello Danny:: Danny Keogh, In a message on 23 July, wrote : DK> DK> Ok, peoples! I thought I knew how to do this but when I tried it DK> it didn't work. No code is needed, I just need to know how to DK> convert a 16-bit sample to an 8-bit sample... That's it. Divide it by 2 ??? Rajesh ... * ATP/Linux 1.50 * Get Charlie off the MTA --- Maximus/2 3.01 * Origin: Kalptaru Net India. http://www.kalptaru.com . (6:606/31) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBX00003 Date: 07/27/97 From: RAJESH DHAWAN Time: 12:09pm \/To: WADE CARPENTER (Read 3 times) Subj: Me again.. HEEEELPPPP!! Hi again Wade:: Wade Carpenter, In a message on 25 July, wrote : WC> Ok.. Here's the problem. This code is meant to write 138 bytes of nforma WC> to a file, "ZS.CFG" but it writes whatever is entered plus garbage, or WC> WC> DOESN'T WORK: WC> #include WC> WC> void main(void) WC> { WC> FILE *fp; WC> char msg[88]; WC> char fspec[50]; /* Insert a couple of lines here and you should be through ..*/ memset(msg,0,88); /* Initializes msg and fspec memset(fspec,0,50); WC> fp = fopen("ZS.CFG","wt"); WC> fwrite(gets(msg),88,1,fp); See you Rajesh ... * ATP/Linux 1.50 * A thief believes that everybody steals. --- Maximus/2 3.01 * Origin: Kalptaru Net India. http://www.kalptaru.com . (6:606/31)