home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13353 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.1 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!smurf.sub.org!incom!orfeo!hotb.sub.org!mania.hotb.sub.org!mania!lkv
  2. From: lkv@mania.hotb.sub.org (Lutz Vieweg)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: GCC vs c++ question
  5. Message-ID: <fVnFr*cY1@mania.hotb.sub.org>
  6. Date: 12 Sep 92 08:50:07 GMT
  7. References: <1992Sep4.151221.12097@sagpd1>
  8. Organization: The Funny Farm
  9. Lines: 24
  10. X-Newsreader: Arn V1.00 alpha rel3
  11.  
  12. In article <1992Sep4.151221.12097@sagpd1>,  writes:
  13.  
  14. >     Here is a program fragment:
  15. >     int min =1;        // global min
  16. >     int main(void)
  17. >     {
  18. >     int min = 5;        // internal min
  19. >     cout << "min 1 is: "<<min--<<"\n";
  20. >         {
  21. >         int min = 9;        // yet another min
  22. >         cout << "min 2 is: "<< ++min<<"\n";
  23. >         cout << min 3 is: "<< --::min<<"\n";
  24. >         }
  25. >     return 0;
  26. >     }
  27. >     The question is, is the C++ syntax for min 3,  --::min or ::--min.
  28. >     Gcc wants it the way in the example. Is that the correct syntax?
  29.  
  30. The scope resolution operator is always part of the variable name - so
  31. why shouldn't that be correct?
  32.  
  33. cu, Lutz Vieweg
  34.