home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12410 < prev    next >
Encoding:
Text File  |  1992-08-16  |  1.8 KB  |  49 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!news.funet.fi!funic!nntp.hut.fi!vipunen.hut.fi!jkokko
  3. From: jkokko@vipunen.hut.fi (Jari Kokko)
  4. Subject: Re: Borland C++ 3.0: Using ifstream
  5. Message-ID: <1992Aug17.074110.5178@nntp.hut.fi>
  6. Summary: Thank you
  7. Keywords: Problem was
  8. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  9. Nntp-Posting-Host: vipunen.hut.fi
  10. Reply-To: jkokko@vipunen.hut.fi (Jari Kokko)
  11. Organization: Helsinki University of Technology
  12. References: <1992Aug12.170957.11478@nntp.hut.fi>
  13. Date: Mon, 17 Aug 1992 07:41:10 GMT
  14. Lines: 33
  15.  
  16. jkokko@lesti.hut.fi (Jari Kokko) wrote:
  17. //Any help is welcome, reply by email, I'll post the answers I get when
  18. //I get this to work.
  19.  
  20. Well, here it is. I got many replys that were of help.
  21. Particularly Anto hit the nail:
  22.  
  23. //  inFile.open("file.txt");
  24. //  // Linker Error:
  25. //  // Undef'd symbol fstreambase::open(const unsigned char far*,int,int)
  26.                                               ^^^^^^^^ 
  27. Anto: By any chance did you set the option to use unsigned char? If
  28. yes, that may be the problem. Try it with default setting (signed
  29. chars).
  30. When you've been staring at something for hours, you don't notice the
  31. simplest errors. UNSIGNED is the key. I had put on option [X] Unsigned
  32. chars (why, don't ask!), and there isn't a constructor for that in
  33. fstream.h. After taking out the X from there everything was peachy.
  34.  
  35. Dan points out:
  36. Then , you can't "cout << inFile" (without overloading "<<").  That is
  37. like saying "cout << stdin".  inFile is a stream, and there is no
  38. difference (in handling) between inFile and, say, cout.  You would
  39. have to do this: cout << file.rdbuf();
  40.  
  41. Thanks for these as well.
  42.  
  43. //I'm sure this is a problem with some silly option
  44. I could say that again,
  45.  
  46. -- 
  47. //jkokko // Email: Jari.Kokko@hut.fi \\ (358)(0) 8794431 \\
  48. ------------------------------------------------------------
  49.