just starting

This is a discussion on just starting within the C Programming forums, part of the General Programming Boards category; How would you go about writing a code fragment that opens a text file for reading. using input.txt as the ...

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    4

    Question just starting

    How would you go about writing a code fragment that opens a text file for reading. using input.txt as the name of the file


    this is a small part of a big program, and i cant figure out how to do it, well i thought i did, but it dont work, so if anyong could help, it would make my night eassier.
    thanks

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    fopen()

    Post your code if you need further help.

    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Check out fopen, fread, and fwrite on MSDN. They should include examples.
    Away.

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    Am i the only one that likes cplusplus.com Reference section?

    By the way, nice MS plug blackrat364
    (i just asked a question on a linux chat and got a windows answer, i am now annoyed)

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by mart_man00
    Am i the only one that likes cplusplus.com Reference section?

    By the way, nice MS plug blackrat364
    (i just asked a question on a linux chat and got a windows answer, i am now annoyed)
    If you've ever actually used MSVC++ with the MSDN installed you'd know just how handy it is. It has nothing to do with plugging it. It's damn handy.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    There is one for linux too!

    its called
    Code:
    man
    Check it some day ^_^

    -LC
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  7. #7
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    I would like to see a more MSDN style Linux site/kit. I wish cplusplus would add to theres or some one would make on here.


    But i have my POSIX book and my Complete Command Reference so im happy for now....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Starting programs
    By Molokai in forum C Programming
    Replies: 1
    Last Post: 04-16-2009, 11:10 AM
  2. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 06:59 PM
  3. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 03:41 AM
  4. question about reading inputs starting with 0
    By jibbles in forum C Programming
    Replies: 8
    Last Post: 08-09-2004, 04:27 AM
  5. 12 year old starting...
    By Xterria in forum Game Programming
    Replies: 2
    Last Post: 09-24-2001, 08:33 PM

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