output a string to a standard output

This is a discussion on output a string to a standard output within the C Programming forums, part of the General Programming Boards category; vs input a string from a standard input.. does anyone have any clue as to what that means at all?...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    36

    output a string to a standard output

    vs input a string from a standard input..


    does anyone have any clue as to what that means at all?

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    In C, you have 3 "files" opened by default:

    • stdout
    • stdin
    • stderr


    The "std" in their names means "standard". The first two are for output and input, respectively. The last one is a special one meant for output used to report error messages.

    When you use a function like printf() or puts(), you're writing to the stdout. Similarly, when you use a function like scanf() or fgets(), you're reading from stdin.

    The phrase "output a string to a standard output" seems slightly off balance, as does the other one you mention, but I believe what you're reading is just basically referring to writing and reading strings from the standard streams.

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    fgets reads from any stream passed as a 3rd parameter, not only a stdin
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Yeah, that was a bad example.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Custom String class gives problem with another prog.
    By I BLcK I in forum C++ Programming
    Replies: 1
    Last Post: 12-18-2006, 02:40 AM
  2. can anyone see anything wrong with this code
    By occ0708 in forum C++ Programming
    Replies: 6
    Last Post: 12-07-2004, 11:47 AM
  3. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 09:33 PM
  4. Another overloading "<<" problem
    By alphaoide in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2003, 10:32 AM
  5. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 01:45 PM

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