Thread: text file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    FIRST
    Code:
    #include <fstream.h>
    #include <iostream.h>
    #include <cstdlib.h>
    #include <ctime.h>
    SECOND
    Code:
    for(i=0;i<9;i++)
    ....

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Quote Originally Posted by enjoy
    FIRST
    Code:
    #include <fstream.h>
    #include <iostream.h>
    #include <cstdlib.h>
    #include <ctime.h>
    ....
    Nope he was absolutely right with the headers he was using. Using fstream.h is not favorable as those headers are officially deprecated.

  3. #3
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    Quote Originally Posted by enjoy
    FIRST
    Code:
    #include <fstream.h>
    #include <iostream.h>
    #include <cstdlib.h>
    #include <ctime.h>
    SECOND
    Code:
    for(i=0;i<9;i++)
    ....
    I'm not sure if you meant it, but both your suggestions are wrong.

    The FIRST one says to use old, non-standard or deprecated headers. Not a good suggestion if bj31t is already using the newer headers.

    The SECOND one still says to print out 9 numbers, even though it corrects the problem with starting at 0.


    EDIT - Too Slow. And by the way, if I'm not mistaken, <iostream.h> and <fstream.h> are not deprecated, they are just old and non-standard. <stdlib.h> and <time.h> on the other hand are standard, but have been deprecated and with the newer headers being preferred.
    Last edited by jlou; 04-28-2004 at 03:51 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  2. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  4. checking values in a text file
    By darfader in forum C Programming
    Replies: 2
    Last Post: 09-24-2003, 02:13 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM