The majority of forums are now only available as archives, which means posting/editing is disabled.
The Anything and Everything forum is still open.
The Anything and Everything forum is still open.
Printing integers without s/printf()
|
|||
|
Rank: ? (1)
Member #: 28473 |
Hello All. I am currently working on a custom library for a project and I have having trouble with a certain function. THis function was designed to to simply take an integer and print it to the screen. e.g. print_int(int x); The problem is that since this is a custom library, I cannot use the standard I/O and can only really, in my view, use write(). I was wondering if anyone could shed some light on this for me or offer advice. Thanks.
|
||
|
|||
|
|||
|
Rank: ? (119)
Member #: 28292 |
Excuse me. I can't help you in the moment and I can't understand you. These standard functions were written for purpose that a programmer should not write such functions again. Why should we create a bicycle? The writing of such functions will take a lot of time. Do you think the that everything in C libraries such as I/O is written in C?. No it isn't. The such delicate functions are written in assembly language using functions of BIOS. If you would write your function you will be forced implementing same methods which the developer of standart functions implemented. You can not use the standard I/O but you can use the function write() which is a standard output function. If you want to use this function why you cannot use other. The function write() as far as I know is used to write a file. By the way you will have to learn a lot of stuff to write this function. Did you use a debugger? Did you go into the output function? You will see how much of stuff is behind of this printf? Try it. Believe me. You will forget this idea immediately.
|
||
|
Please login or register to post a reply.
