Input for C program

This is a discussion on Input for C program within the Linux Programming forums, part of the Platform Specific Boards category; I am using scanf for getting user's input. Is it possible to read data from another file using scanf ( ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    3

    Lightbulb Input for C program

    I am using scanf for getting user's input. Is it possible to read data from another file using scanf ( not fscanf) by using piping facility in Linux?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    Yes - try it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 02:30 PM
  2. Utter newb?: Program crashes after input
    By deductible in forum C++ Programming
    Replies: 5
    Last Post: 12-13-2008, 09:27 PM
  3. large program code ,please help
    By Ash1981 in forum C Programming
    Replies: 14
    Last Post: 01-30-2006, 05:16 AM
  4. provide input to another program
    By oncemyway in forum C Programming
    Replies: 14
    Last Post: 07-31-2005, 04:12 PM
  5. Input via the serial port for a C program
    By Anthony in forum C++ Programming
    Replies: 2
    Last Post: 07-11-2005, 02:19 PM

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