home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 January / Chip_2000-01_cd.bin / sharewar / prtrk / 2_0009.PR < prev    next >
Encoding:
Text File  |  1995-06-06  |  738 b   |  47 lines

  1. :Title=Scope resolution operator
  2. :Priority=3 Major
  3. :Status=New
  4. :Type=C++ Compiler
  5. :SubType=
  6. :Method=System Test
  7. :Property1=0
  8. :Property2=0
  9. :Property3=0
  10. :Property4=0
  11. :Originator=Tom Tester
  12. :Investigator=
  13. :Resolver=
  14. :Verifier=
  15. :OrigDate=04-Jun-95
  16. :EstInvHours=  0.0
  17. :ActInvHours=  0.0
  18. :EstResHours=  0.0
  19. :ActResHours=  0.0
  20. :EstVerHours=  0.0
  21. :ActVerHours=  0.0
  22. :ModDate=06-Jun-95
  23. Version: 4.135
  24.  
  25. The scope resolusion operator is not resolving scope as it should.  Consider the code.
  26.  
  27. int a;
  28.  
  29. main()
  30. {
  31. int a;
  32. a = 3;
  33. cout << "local a = " << a << "\n"
  34. cout << "global a = " << :: << "\n"
  35. }
  36. The code results in the output:
  37.  
  38. local a = 2
  39. global a = 2
  40.  
  41. The output should be
  42.  
  43. local a = 3
  44. global a = 2
  45.  
  46.  
  47.