Re: Output without stdio.h or iostream

Discussion in 'C Programming' started by Malcolm, Jul 3, 2003.

  1. Malcolm

    Malcolm Guest

    "Gabriel Flemming" <> wrote in message
    > i heard it wouldn't be possible to build a function that sends output
    > (maybe a text string) to the console without using the C/C++
    > standard-functions from the standard library (puts,printf or
    > whatever)...
    >
    > is this correct?
    >

    As you point out, the compiler has to implement printf() etc somehow, which
    means that there must be a way of writing code that interacts at a low level
    with the screen.
    On some platforms, it is quite easy to do this in C. For instance, on an old
    DOS machine you can find out the screen memory address using a
    platform-specific function called int86(), and then write to the screen
    directly. Thus you can build your own output functions.
    However on other platforms it is a very difficult thing to do. They might
    not allow you to access the screen buffer directly unless you are running in
    a special privileged mode, for example. It might then be impossible to write
    an output function in C without using the compiler-supplied stdio functions.
    Using an assembler, and having all the privileges you want, you will of
    course be able to overcome these limitations. Someone, somewhere, has to
    implement an interface with the screen or other output device.
     
    Malcolm, Jul 3, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vicent

    iostream or stdio

    Vicent, Aug 25, 2003, in forum: C++
    Replies:
    2
    Views:
    1,732
  2. Joona I Palaste

    Re: Output without stdio.h or iostream

    Joona I Palaste, Jul 3, 2003, in forum: C Programming
    Replies:
    0
    Views:
    715
    Joona I Palaste
    Jul 3, 2003
  3. Lew Pitcher

    Re: Output without stdio.h or iostream

    Lew Pitcher, Jul 3, 2003, in forum: C Programming
    Replies:
    0
    Views:
    743
    Lew Pitcher
    Jul 3, 2003
  4. Dan Pop

    Re: Output without stdio.h or iostream

    Dan Pop, Jul 4, 2003, in forum: C Programming
    Replies:
    0
    Views:
    376
    Dan Pop
    Jul 4, 2003
  5. Replies:
    18
    Views:
    1,907
    crazzybugger
    Oct 22, 2006
Loading...

Share This Page