Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Output without stdio.h or iostream

Thread Tools

Re: Output without stdio.h or iostream

Dan Pop
Posts: n/a
In <(E-Mail Removed) > Removed) (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
>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

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 Pop
DESY Zeuthen, RZ group
Email: (E-Mail Removed)
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Semi OT: Mixing iostream and iostream.h red floyd C++ 3 03-08-2005 05:57 PM
iostream + iostream.h S. Nurbe C++ 7 01-15-2005 07:49 AM
is MS newer <iostream> is slower than older <iostream.h>? ai@work C++ 9 12-16-2004 08:21 PM
#include <iostream.h> or <iostream> John Tiger C++ 10 08-06-2003 01:30 PM
Re: Output without stdio.h or iostream Joona I Palaste C Programming 0 07-03-2003 02:56 PM