hey all, im a new programmer.
i was wondering how you would go about writing the printf function yourself? it is my understanding that when you call printf you are calling an already written function and just providing an argument? if this is the case, is it possible to write that function yourself with just the bare primitives of the language? i only want to know because i am curious about how things like that work.
---------- Post updated 05-01-10 at 01:19 AM ---------- Previous update was 04-30-10 at 10:05 PM ----------
just to update, i've researched that the gcc compiler is written mostly in C, and so it's likely that the code for all these built-in c functions are written in C as well. so i take that to mean i could somehow write a printf-like function.
i suppose my best bet would be to look at the gcc source and just find it. however, not being a good programmer yet ( i only started just last week), i have no idea where i would find it
. if anyone could point me in the right direction, or explain how i might write it, i would be very happy