0

we are using printf and scanf from #include<stdio.h> libraray functions.is it possible to write our own display statement and input statement

4
Contributors
4
Replies
7
Views
4 Years
Discussion Span
Last Post by rithish
0

yes u can. You can use putchar() and getchar and you can write fucntions using that.

0

Do you mean you want to write your own library for I/O or use macros for those existing functions? also fyi the latter is bad programming

0

is it possible to write our own display statement and input statement

Certainly. How do you think the stuff from stdio.h was written? One cool thing about the standard C library is pretty much all of it can be written directly in C. I've actually implemented the standard C library before, and whole books have been written with that focus.

As far as writing your own output function without utilizing the standard library, you'll almost certainly end up using a system library like Linux's write() or Windows' WriteFile(). Sure, you could use assembly interrupts, but that's just crazy talk unless you're writing for a platform that for some reason doesn't expose a C interface for I/O.

On a side note, the linked book is one of my favorites. The code is a hard read, but you can learn a lot from it.

0

everyone is reading from dennis ritchie implementations of library function.similiar to this in java package concept they are writting import java.awt.event where action listner they r writting i dont know how a byte code is translated into program such a great thing that is

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.