Reading Files in C

This is a discussion on Reading Files in C within the C Programming forums, part of the General Programming Boards category; I was once a Computer Science major (12 years ago), then switched to Meteorology before forgetting everything I'd learned about ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    1

    Reading Files in C

    I was once a Computer Science major (12 years ago), then switched to Meteorology before forgetting everything I'd learned about programming.

    SO... now I'm working on my master's thesis and have found that I need to write some code. Yay. Basically, I need to open a file (may be variable in size) of weather information and import those data (10 columns across and many, many lines(rows) long) into an array for comparison with another array that needs to be created in a similar manner.

    One issue is that the array will have to be variable in size to accommodate variable datafile sizes.

    Other issue is I have no idea how to open the files and read them.

    How can this be done in C? I could use MATLAB, I suppose, but would rather use C if I can.

    Thank you,

    Mike

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    You could start with the FAQ on reading files.

    ~/

  3. #3
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,171
    With the variable length data files you'll probably need to do some reading on dynamic memory allocation as well.
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading User Defined Files
    By Necrofear in forum C++ Programming
    Replies: 17
    Last Post: 06-30-2006, 01:55 AM
  2. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  3. reading files
    By hiya in forum C++ Programming
    Replies: 7
    Last Post: 05-21-2005, 12:40 PM
  4. A little help reading from files...
    By Invincible in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2002, 10:43 AM
  5. Need Advice in reading files
    By jon in forum C Programming
    Replies: 4
    Last Post: 10-07-2001, 08:27 AM

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