home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / msdos / programm / 8101 < prev    next >
Encoding:
Text File  |  1992-07-26  |  1.3 KB  |  33 lines

  1. Path: sparky!uunet!cs.utexas.edu!news
  2. From: phil@cs.utexas.edu (Philip Smolen)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: #include <iostream.h> cout "Hello World\n" hassle (kindergarten prob, I guess)
  5. Date: 26 Jul 1992 23:30:07 -0500
  6. Organization: U Texas Dept of Computer Sciences, Austin TX
  7. Lines: 21
  8. Message-ID: <l76uufINN816@muleshoe.cs.utexas.edu>
  9. References: <0095E0C9.C1EA64E0@Msu.oscs.montana.edu>
  10. NNTP-Posting-Host: muleshoe.cs.utexas.edu
  11.  
  12. In article <0095E0C9.C1EA64E0@Msu.oscs.montana.edu> imsks126@Msu.oscs.montana.edu writes:
  13.  
  14. >What am I doing wrong? If I #include <iostream.h> I can
  15. [working program deleted]
  16. >void main(void){                   void main(void){
  17. >  char str[6];
  18. >                                     cout << "Uga Buga";
  19. >  str = "Uga Buga";                  }
  20. >  cout << str;
  21. >  }
  22. >
  23. >in both cases I get linker error "undef symbol in ostream:: etc."
  24.  
  25. Strange.  I compiled the last two programs just now and got exactly what I
  26. expected.  The one on the left wouldn't even compile.  (An array name is
  27. a constant pointer, and thus not an lvalue.)  The one on the right printed
  28. the message on the screen.  I am using CC on a SUN/SPARC.
  29.  
  30. Perhaps the problem is in your compiler or the way you set it up.
  31.  
  32.                                         --Phil
  33.