Print without using any inbuilt function?

Discussion in 'C Programming' started by ragav, Dec 8, 2006.

  1. ragav

    ragav Guest

    How can i print anything without using printf( ) or anyother inbuilt
    function calls??
     
    ragav, Dec 8, 2006
    #1
    1. Advertising

  2. "ragav" <> writes:
    > How can i print anything without using printf( ) or anyother inbuilt
    > function calls??


    Use a pen and paper.

    Questions of the form "How can I do X without using Y", where Y is the
    obvious way to do X, are almost invariably homework.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Dec 8, 2006
    #2
    1. Advertising

  3. ragav

    santosh Guest

    ragav wrote:
    > How can i print anything without using printf( ) or anyother inbuilt
    > function calls??


    printf() is not in-built in the C language. There's no portable answer
    to your question. Under _certain_ systems, you may be able to print to
    the display by writing character code values into the video memory, but
    ask further questions in this regard to more system specific groups.
     
    santosh, Dec 8, 2006
    #3
  4. ragav said:

    > How can i print anything without using printf( ) or anyother inbuilt
    > function calls??


    printf( ) isn't an inbuilt function call. It's just a function call.

    If you don't want to use printf, use vprintf or vfprintf or puts or putchar
    or putc or fputc or even fwrite. None of these are inbuilt function calls.

    What's wrong with printf, anyway? Don't you like it?

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at the above domain, - www.
     
    Richard Heathfield, Dec 8, 2006
    #4
  5. ragav

    Richard Bos Guest

    "santosh" <> wrote:

    > ragav wrote:
    > > How can i print anything without using printf( ) or anyother inbuilt
    > > function calls??

    >
    > printf() is not in-built in the C language.


    Yes, it is. It's defined in the ISO C Standard, which: "specifies the
    form and establishes the interpretation of programs written in the C
    programming language."

    Richard
     
    Richard Bos, Dec 8, 2006
    #5
  6. ragav

    pete Guest

    ragav wrote:
    >
    > How can i print anything without using printf( ) or anyother inbuilt
    > function calls??


    You could use the putc macro if there is one,
    but in order to ensure that putc is a macro
    and that it also does not make a call to a built in function,
    you would also need a genie.

    --
    pete
     
    pete, Dec 8, 2006
    #6
  7. In article <>,
    ragav <> wrote:
    >How can i print anything without using printf( ) or anyother inbuilt
    >function calls??


    You could use FORTRAN.

    -- Richard



    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, Dec 8, 2006
    #7
  8. ragav

    soccertl Guest

    ragav wrote:
    > How can i print anything without using printf( ) or anyother inbuilt
    > function calls??


    Write an assembly module.
     
    soccertl, Dec 8, 2006
    #8
  9. ragav

    santosh Guest

    Richard Bos wrote:
    > "santosh" <> wrote:
    >
    > > ragav wrote:
    > > > How can i print anything without using printf( ) or anyother inbuilt
    > > > function calls??

    > >
    > > printf() is not in-built in the C language.

    >
    > Yes, it is. It's defined in the ISO C Standard, which: "specifies the
    > form and establishes the interpretation of programs written in the C
    > programming language."


    Not for freestanding implementations.
     
    santosh, Dec 8, 2006
    #9
  10. ragav

    ais523 Guest

    ragav wrote:

    > How can i print anything without using printf( ) or anyother inbuilt
    > function calls??

    It depends on what you mean by 'print'. The following program:

    #error Hello, world!

    will generate a diagnostic when compiled with a conforming C compiler;
    this diagnostic may quite possibly meet your definition of 'print'.

    --
    ais523
     
    ais523, Dec 8, 2006
    #10
  11. On 8 Dec 2006 08:09:02 -0800, in comp.lang.c , "santosh"
    <> wrote:

    >Richard Bos wrote:
    >> "santosh" <> wrote:
    >>
    >> > ragav wrote:
    >> > > How can i print anything without using printf( ) or anyother inbuilt
    >> > > function calls??
    >> >
    >> > printf() is not in-built in the C language.

    >>
    >> Yes, it is. It's defined in the ISO C Standard, which: "specifies the
    >> form and establishes the interpretation of programs written in the C
    >> programming language."

    >
    >Not for freestanding implementations.


    Its still part of the C language definition..

    Also, how likely do you think it is that the OP is working on a
    freestanding implemetation?
    --
    Mark McIntyre

    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it."
    --Brian Kernighan
     
    Mark McIntyre, Dec 9, 2006
    #11
  12. ragav

    santosh Guest

    Mark McIntyre wrote:
    > santosh wrote:
    > >Richard Bos wrote:
    > >> santosh wrote:
    > >> > ragav wrote:
    > >> > > How can i print anything without using printf( ) or anyother inbuilt
    > >> > > function calls??
    > >> >
    > >> > printf() is not in-built in the C language.
    > >>
    > >> Yes, it is. It's defined in the ISO C Standard, which: "specifies the
    > >> form and establishes the interpretation of programs written in the C
    > >> programming language."

    > >
    > >Not for freestanding implementations.

    >
    > Its still part of the C language definition..


    Yes. I assumed that the OP meant by word 'inbuilt' as to being built
    into the compiler proper. Which is why I answered as I did. Looking
    back, I certainly expressed it the wrong way.
     
    santosh, Dec 9, 2006
    #12
  13. Tuning the answer to the receiver (Was: Print without using any inbuilt function?)

    In article <>,
    Mark McIntyre <> wrote:
    ....
    >Also, how likely do you think it is that the OP is working on a
    >freestanding implemetation?


    But, alas, the sentiment behind that statement goes for 99% of the
    "advice" given in this ng. The typical "I just want my Windows GUI app
    that was assigned to me as homework program to work so I can pass this
    da** class" poster generally could not care less about the sort of
    "Well, the standard says..." kind of advice that the regs here dish out.

    But we do it anyway. So, let's not be hypocritical about it.
     
    Kenny McCormack, Dec 9, 2006
    #13
  14. ragav

    Neil Guest

    Richard Heathfield wrote:
    > ragav said:
    >
    >> How can i print anything without using printf( ) or anyother inbuilt
    >> function calls??

    >
    > printf( ) isn't an inbuilt function call. It's just a function call.
    >
    > If you don't want to use printf, use vprintf or vfprintf or puts or putchar
    > or putc or fputc or even fwrite. None of these are inbuilt function calls.
    >
    > What's wrong with printf, anyway? Don't you like it?
    >


    One of 2 reasons
    01) Homework
    10) 8 bit compiler (printf is big)
     
    Neil, Dec 14, 2006
    #14
    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. Raja
    Replies:
    2
    Views:
    14,977
  2. km

    inbuilt function buffer()

    km, Jan 20, 2005, in forum: Python
    Replies:
    0
    Views:
    381
  3. santosh
    Replies:
    5
    Views:
    897
    Nick Keighley
    Mar 11, 2010
  4. Replies:
    5
    Views:
    145
    Mirco Wahab
    Aug 20, 2007
  5. kaushal
    Replies:
    3
    Views:
    194
    Dr J R Stockton
    Aug 11, 2008
Loading...

Share This Page