Loading ...
Sorry, an error occurred while loading the content.
 

Error with ios::nocreate

Expand Messages
  • prad in
    Hi All, I get compilation err when i have. Any idea what may be the problem ifstream ifile; ifile.open(fileNam,ios::in,ios::nocreate); I have included
    Message 1 of 2 , Dec 10, 2005
      Hi All,
      I get compilation err when i have. Any idea what may
      be the problem
      ifstream ifile;
      ifile.open(fileNam,ios::in,ios::nocreate);
      I have included <fstream> and i'm using namespace std

      datastruc.cc: In member function `void
      dataList::readFrmFile(char*)':
      datastruc.cc:116: `nocreate' is not a member of type
      `std::basic_ios<char,
      std::char_traits<char> >'
      menu.cc: In member function `void
      menu::help(display&)':
      menu.cc:186: `nocreate' is not a member of type
      `std::basic_ios<char,
      std::char_traits<char> >'
      menu.cc:191: `nocreate' is not a member of type
      `std::basic_ios<char,
      std::char_traits<char> >'


      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • badhri
      ... I think this may help: http://www.devx.com/tips/Tip/14544 -badhri P.S: Next time around post the relevant pieces of code (do *not* copy-paste the entire
      Message 2 of 2 , Dec 10, 2005
        On 12/10/05, prad in <pradpin@...> wrote:
        > Hi All,
        > I get compilation err when i have. Any idea what may
        > be the problem
        > ifstream ifile;
        > ifile.open(fileNam,ios::in,ios::nocreate);
        > I have included <fstream> and i'm using namespace std
        >
        > datastruc.cc: In member function `void
        > dataList::readFrmFile(char*)':
        > datastruc.cc:116: `nocreate' is not a member of type
        > `std::basic_ios<char,
        > std::char_traits<char> >'
        > menu.cc: In member function `void
        > menu::help(display&)':
        > menu.cc:186: `nocreate' is not a member of type
        > `std::basic_ios<char,
        > std::char_traits<char> >'
        > menu.cc:191: `nocreate' is not a member of type
        > `std::basic_ios<char,
        > std::char_traits<char> >'

        I think this may help: http://www.devx.com/tips/Tip/14544

        -badhri

        P.S: Next time around post the relevant pieces of code (do *not*
        copy-paste the entire file), so that we can avoid random guesses.
      Your message has been successfully submitted and would be delivered to recipients shortly.