Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: [SOLVED] Taking input using C

  1. #11
    Join Date
    Feb 2008
    Beans
    367

    Re: [SOLVED] Taking input using C

    Quote Originally Posted by nvteighen View Post
    Well, that's pure UNIX philosophy!
    I'm not sure if this is good or bad.

    Enlighten me. Maybe I can learn something.

  2. #12
    Join Date
    Aug 2007
    Location
    Kottawa, Sri Lanka
    Beans
    7,387
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [SOLVED] Taking input using C

    Quote Originally Posted by LaRoza View Post
    The C standard library isn't big.

    See my wiki.
    I had a look around your wiki yesterday and it certainly looks like a great resource. My congratulations on maintaining such a great and professional looking wiki LaRoza.
    Think carefully before executing commands containing "rm", especially "sudo rm -rf ", if you require more information concerning this matter, read this.
    I am an experimenter, give me the most stable OS and I can make it unstable in a few hours.

    C == seriously fast == FTW!

  3. #13
    Join Date
    Apr 2007
    Beans
    14,781

    Re: [SOLVED] Taking input using C

    Quote Originally Posted by PmDematagoda View Post
    I had a look around your wiki yesterday and it certainly looks like a great resource. My congratulations on maintaining such a great and professional looking wiki LaRoza.
    Thanks. I hope people find it useful

    There are bits I need to update though.

  4. #14
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: [SOLVED] Taking input using C

    Quote Originally Posted by namegame View Post
    I'm not sure if this is good or bad.

    Enlighten me. Maybe I can learn something.
    Sure: http://www.linfo.org/unix_philosophy.html, http://en.wikipedia.org/wiki/Unix_philosophy

    The UNIX Philosophy is actually all about keeping modularity at all levels: at code but also at the system itself. Modularity in code is probably something you already know and hopefully also use: structured programming, avoiding globals, "1 function <=> 1 task", etc. C was designed to be used that way; the so-called "C Philosophy" is the same as the UNIX one... both were created simultaneously by the same people for the very same project.

    At system level, it's about having "1 task <=> 1 program" and make the system be a net of interconnected programs communicating eachother (Just the same as you do when using functions in your C programs). This communication can be done through different channels: the pipe, the program's main() return value (have you ever wondered why main() has to return something?), etc. For that, everything has to use a common interface, which in UNIX is the file. That's why stdout, stdin are always files (either a plaintext or a device file or whatever) and why you can redirect I/O to wherever you like.

    Obviously, using fprintf() over printf() doesn't affect that behaivor. You can still redirect output in a program that uses printf() as this function can be considered to act as a macro for fprintf(stdout, ...). (that's not what really happens as we first need to parse the variable argument list, but the effect is the same).

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •