This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Where is the source-code of prinf & scanf

After having some trouble with scanf & printf
(scanf receives 0x0D and convertes this to 0x0A)
(printf attaches CR to \n)

i ask myself: where's the Sourcecode of all this function's?
Printf & scanf sin, cos and all this stuff are library-functions.
Can they be changed, it is useful to change them?
Can i learn something for example how sin is computed?

Of course i've learned from this: now i use my own my_putchar & my_getkey when transmitting/receiving singele binary char's.

Parents
  • "More sensible [...] is to not use them at all but write your own functions to your own specific requirements!"

    I agree. The printf family generally means a large chunk of lib code that will be linked to your system. Generally you will use but a few cases of formatted output or input, and that can generally be written in smaller C functions. In a few cases, it makes sense to use them, but when you need fast and small code, specific functions are a better option.

Reply
  • "More sensible [...] is to not use them at all but write your own functions to your own specific requirements!"

    I agree. The printf family generally means a large chunk of lib code that will be linked to your system. Generally you will use but a few cases of formatted output or input, and that can generally be written in smaller C functions. In a few cases, it makes sense to use them, but when you need fast and small code, specific functions are a better option.

Children
No data