In < >
(Gabriel Flemming) writes:
>i heard it wouldn't be possible to build a function that sends output
>(maybe a text string) to the console without using the C/C++
>standard-functions from the standard library (puts,printf or
>whatever)...
>
>is this correct?
Yes, as far as portable programming is concerned.
>or is there any possibility of writing such a function WITHOUT the
>usage of any function from the standard library?
If you *completely* ignore the standard library, how do you expect to
generate any output? OTOH, a non-portable solution that doesn't use
anything from <stdio.h> or its C++ counterpart is trivial to write:
#include <stdlib.h>
...
system("echo hello, world");
Works on both Unix and DOS, it will probably fail on VMS.
>to me, it doesn't make sense, that it could be impossible to do this,
>because every of the standard functions has to be implemented in the
>compiler (AND THEREFORE THERE HAS TO EXIST THE NEEDED CODE, HASN'T
>IT???).
That code normally uses non-standard library functions that provide the
interface with the operating system primitives. If you dig deep enough,
at some point you'll discover a bit of assembly (e.g. the implementation
of syscall() on most Unix systems).
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: