Thread: Newbie file reading question

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    1

    Newbie file reading question

    Hi I'm trying to make a simple program to read a text file.

    PLEASE NOTE that I'm using Linux... thanks

    Here is what I want my program to do:

    - Read a filename from the command line argument
    - open up the file and read the contents line by line
    - Display the file name in STDOUT

    How would I use a makefile to build this program?

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Do you know what you're saying? You don't need a makefile. You need code for the program. Compiling it should be a trivial matter, not even worth having a makefile for.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Replies: 9
    Last Post: 03-29-2010, 09:07 PM
  3. File input question from a newbie
    By Dylancougar in forum C Programming
    Replies: 9
    Last Post: 10-20-2005, 06:14 PM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. Replies: 3
    Last Post: 03-04-2005, 02:46 PM