Thread: odd I/O compile error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Is it recommended to use ios::app or ios_base::app?
    ios_base::app is recommended simply because the C++ standard makes no mention of ios::app being valid that I can remember.
    My best code is written with the delete key.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Quote Originally Posted by Prelude
    >Is it recommended to use ios::app or ios_base::app?
    ios_base::app is recommended simply because the C++ standard makes no mention of ios::app being valid that I can remember.
    If you don't mind, I'll correct myself before someone else does. After looking at the standard, both are valid. ios_base is where the openmode app is defined, but ios is a typedef defined as
    Code:
    typedef basic_ios<char> ios;
    Where basic_ios is a template class derived from ios_base. So both will work, both are standard, and which you use looks to be a matter of style.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM