home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15896 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.3 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!news.ans.net!europa.asd.contel.com!paladin.american.edu!auvm!ksadegh
  2. Organization: The American University - University Computing Center
  3. Date: Fri, 6 Nov 1992 18:44:52 EST
  4. From: Kayvon Z. Sadeghi <KSADEGH@auvm.american.edu>
  5. Message-ID: <92311.184452KSADEGH@auvm.american.edu>
  6. Newsgroups: comp.lang.c++
  7. Subject: const char *
  8. Lines: 32
  9.  
  10. Hi
  11.  
  12. I was wondering if there is any difference between the way C, and C++
  13. handle the "const char *" decleration. You see, I have this peice of code
  14. that I know it works on C, but my C++ compiler behaves a bit strange.
  15.  
  16. I have this subroutine call that says:
  17.  
  18. mycall("");
  19.  
  20.  
  21. and then somewhere down in my code I have:
  22.  
  23.  mycall(const char *msg){
  24.      if(msg=="")
  25.           dothis();
  26.      if(msg!="")
  27.           dothat();
  28. }
  29.  
  30. Strange, but my compiler doesthat() instead of dothis().
  31. I even checked the value of msg and it *IS* equal to "". Is something wrong
  32. with my C++ compiler or what? or are strings treated differently in here?
  33.  
  34. thanks
  35. k1
  36. ---
  37. ------------------------------------------------------------------------
  38.      Of Course,  I Could Be Wrong !!!
  39. ------------------------------------------------------------------------
  40. Kayvon Sadeghi                    k.sadeghi@ieee.org
  41. Voice:202/244-0789
  42.