| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: C++ for beginners? |
From: Gregg N
Geo wrote:
> "Tony Williams" wrote in message
> news:41a10115{at}w3.nls.net...
>
>>The C "way" is
>>The C++ "way" is
>
>
> I'm still unclear on what the differences between these are, I mean as far
> as I can see they are the same with C++ just being a step further towards
> the OO type stuff. Both appear to be built upon the same base.
The C++ "way" has a couple of advantages over the C "way":
Type safety
Performance
Type safety means that the compiler will catch mistakes such as trying to
use your CompareSheep function to sort street address records.
Performance is due to the possibility of inlining the comparison operation,
which is not possible with the qsort function (since it relies on the use
of a generic function pointer with void* parameters).
Note too that some of the container classes such as std::list have a
built-in sort function.
For what it's worth, qsort is a valid part of the C++ library. It just is
not recommended for new work.
The fact that you are using Visual C++ 6 is irrelevant to this discussion.
Gregg
--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)SEEN-BY: 633/267 270 5030/786 @PATH: 379/45 1 396/45 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.