home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 12924 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.1 KB  |  59 lines

  1. Path: sparky!uunet!sun-barr!cs.utexas.edu!unisql!nandraj
  2. From: nandraj@unisql.UUCP (Nandraj Arni)
  3. Newsgroups: comp.lang.c++
  4. Subject: enum problem.
  5. Message-ID: <3532@unisql.UUCP>
  6. Date: 26 Aug 92 18:16:57 GMT
  7. Reply-To: nandraj@unisql.UUCP (Nandraj Arni)
  8. Organization: UniSQL, Inc., Austin, Texas, USA
  9. Lines: 48
  10.  
  11.  
  12.    I have this problem. Two versions of GNU's compilers are
  13. acting in different ways. Which is correct?
  14.  
  15. Example:
  16. -------
  17.  
  18. class EnumTest {
  19.  
  20. public:
  21.  enum varType { Apple, Orange};
  22.  
  23.  varType get_fn();
  24.  
  25. }
  26.  
  27.  
  28. >>>>> The question is how to define get_fn?
  29.  
  30. One version:
  31. -----------
  32.  
  33. varType EnumTest::get_fn()
  34. {
  35. ...
  36. }
  37.  
  38. Other version:
  39. -------------
  40.  
  41. EnumType::varType EnumTest::get_fn()
  42. {
  43. ...
  44. }
  45.  
  46.   Neither compilers like the other definition.
  47.  
  48. -- 
  49. *******************************************************************
  50. Nandraj Arni
  51.  
  52. UniSQL, Inc.                           Voice: 512 343 7372 Ext. 107
  53. 9390 Research Blvd.                              Home: 512 794 9386
  54. Kaliedo II                             FAX: 512 343 7383
  55. Austin, TX 78759
  56.  
  57. Email: unisql!nandraj@cs.utexas.edu
  58. *******************************************************************
  59.