file open mode questions

This is a discussion on file open mode questions within the C++ Programming forums, part of the General Programming Boards category; Should Code: ofstream s(name.c_str()); and Code: ifstream s(name.c_str(), ios_base::out); give the same results?...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    did you mean
    Code:
    fstream s(name.c_str(), ios_base::out);
    in the second line code?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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, 01: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, 02:58 PM
  5. Invoking MSWord
    By Donn in forum C Programming
    Replies: 21
    Last Post: 09-08-2001, 04:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21