TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: SUNIR SHAH
from: THOMAS MAEDER
date: 1997-07-20 13:36:00
subject: Sunir ventures into C++

SS> void foo( int& HeyIMagicallyAlterYourVariableWithoutTellingYou )
Hey, look again! I tell you I alter your variable! I'm a reference!
SS>     /* 2. Declaring data in random places */
SS>     int HiIAmRandomlyDeclaredHere;
This feature alone makes it worth for a C  programmer  to  use  a  C++
compiler to compile his code.
If you always declare a variable where you initialize it, you'll never
forget to erase the declaration when you don't need the  variable  any
more. More, you won't read from an uninitialized variable.
SS>     ...
SS>     ...
SS>     HiIAmRandomlyDeclaredHere = ButICannotFindWhereHereIs; 
Of course, you lose all advantages if you do it like this. Rather write:
int HiIAmRandomlyDeclaredHere = ButICannotFindWhereHereIs;
SS>     HiIAmRandomlyDeclaredHere = ButICannotFindWhereHereIs; // a=b
SS>                                        /* 3. Assembly comments */
//  comments are quite handy, because you can easily temporarily out a
sequence of code lines containing them using /* */.
SS>     /* 4. C-style casts are outlawed as of the latest draft proposal
SS>     long bar;
SS>      int baz = (long)bar;
That's new to me.
The standard just offers you new possibilities that are  far  superior
because  you can write now more explicitly what you are doing when you
cast and because the length of the new keywords makes you  think  once
more before casting.
SS>     CATCH TRY IAMAFISH THESE_ARE_ALL_VALID BECAUSEC++CHANGES EVERYWE
I like fish :-)
Thomas
---
 þ MM 1.0 #0113 þ SYNTAX? Why not, they tax everything else!
---------------
* Origin: McMeier & Son BBS (2:301/138)

SOURCE: echomail via exec-pc

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™.