read from standard input a list of filenames?

This is a discussion on read from standard input a list of filenames? within the C Programming forums, part of the General Programming Boards category; How would a C program read a list of files entered by the user?...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    30

    read from standard input a list of filenames?

    How would a C program read a list of files entered by the user?

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Use fgets() to take in the string (the file names), and check them for good input, then put them into a char array with 2 dimensions, aka an array of strings.

    If the list was long, it would be a char array of pointers to strings, to save memory.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. One more linked list implementation
    By BlackOps in forum C Programming
    Replies: 17
    Last Post: 07-16-2009, 10:34 PM
  2. deleting a node in linked list
    By BoneXXX in forum C Programming
    Replies: 18
    Last Post: 12-17-2007, 12:30 PM
  3. Pleas take a look & give a critique
    By sh3rpa in forum C++ Programming
    Replies: 14
    Last Post: 10-19-2007, 11:01 PM
  4. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 09:55 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 11:21 PM

Tags for this Thread


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