Thread: file open mode questions

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    65

    file open mode questions

    Should
    Code:
    ofstream s(name.c_str());
    and
    Code:
    ifstream s(name.c_str(), ios_base::out);
    give the same results?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    did you mean
    Code:
    fstream s(name.c_str(), ios_base::out);
    in the second line code?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  2. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  4. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM
  5. Invoking MSWord
    By Donn in forum C Programming
    Replies: 21
    Last Post: 09-08-2001, 04:08 PM