Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!decwrl!labrea!rutgers!ucsd!ames!mailrus!cornell!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!ssc!mcgp1!fst From: fst@mcgp1.UUCP (Skip Tavakkolian) Newsgroups: comp.lang.c++ Subject: Re: operator precedence question Summary: Bad practice and style? Message-ID: <1468@mcgp1.UUCP> Date: 24 Jul 88 06:55:11 GMT References: <36592@linus.UUCP> <5335@june.cs.washington.edu> Organization: Computer Tools Int'l Inc. Lines: 36 In article <5335@june.cs.washington.edu>, pardo@june.cs.washington.edu (David Keppel) writes: > [ Tried e-mail, but it bounced on 3 different addresses. *sigh* ] > > In article <347@gt-eedsp.UUCP> baud@gteedsp.gatech.edu writes: > >[ ... int i=0, t=s; ... Why is this not char *t = char* s? ] > > Because C++ is backwards compatible with C, and the C declaration [ deleted ] At the risk of getting torched, I should say that allowing this type of variable declaration, without a clean way to declare multiple variables, makes the language ugly. And if I understand correctly, the scope of the variable declared in such a manner is to end of the current block. In my opinion this is a mis-feature, since C already allows such thing as: void foo() { bar(); { int i; char *cp; for (i = 0, cp = "THIS"; i < 4; i++) *cp++ = 'z'; } baz(); } I am just learning C++ and I know that I (dare I say it) love the language. It is mostly very clean and logical. Could someone give me one good reason for allowing such variable declarations? Sincerely -- Fariborz ``Skip'' Tavakkolian UUCP ...!uw-beaver!tikal!mcgp1!fst UNIX is a registered trademark of AT&T