home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / std / cplus / 1532 < prev    next >
Encoding:
Text File  |  1992-11-10  |  910 b   |  30 lines

  1. Path: sparky!uunet!know!cass.ma02.bull.com!think.com!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!natinst.com!news.dell.com!math.utexas.edu!ut-emx!emx.cc.utexas.edu
  2. From: jamshid@emx.cc.utexas.edu (Jamshid Afshar)
  3. Newsgroups: comp.std.c++
  4. Subject: Can Standard C functions be overloaded?
  5. Message-ID: <83359@ut-emx.uucp>
  6. Date: 11 Nov 92 02:14:41 GMT
  7. Sender: jamshid@ut-emx.uucp
  8. Organization: The University of Texas at Austin; Austin, Texas
  9. Lines: 19
  10.  
  11.  
  12. Can Standard C functions be overloaded?
  13.  
  14.     #include <string.h>
  15.     int atoi(const String&);   // legal?
  16.     char* s = "123";
  17.     String str = "456";
  18.     int i1 = atoi(s);
  19.     int i2 = atoi(str);
  20.  
  21. One problem, I believe, is that ANSI C allows functions to be defined
  22. by the implementation as macros, so you might have to do:
  23.  
  24.     int (atoi)(const String& s);  // now legal?
  25.     String str = "456";
  26.     int i = (atoi)(str);   // annoying
  27.  
  28. Jamshid Afshar
  29. jamshid@emx.utexas.edu
  30.