Thread: read from standard input a list of filenames?

  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, 09: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, 10:01 PM
  4. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 08:55 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM

Tags for this Thread