Velocity Reviews

Velocity Reviews (
-   C Programming (
-   -   Re: Output without stdio.h or iostream (

Lew Pitcher 07-03-2003 03:08 PM

Re: Output without stdio.h or iostream
On 3 Jul 2003 07:52:30 -0700, (Gabriel Flemming)

>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. But, as it is implementation dependant, it isn't discussed here.

>or is there any possibility of writing such a function WITHOUT the
>usage of any function from the standard library?

Yes again.

>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

Nonsense. The standard functions have to accompany the compiler; the compiler
doesn't have to implement them in the same manner that it implements a switch()
or if() statement. I/O functions are /not necessarily/ intrinsic to the compiler
(unlike COBOL or Fortran, where the I/O facilities are parsable language
elements, and not callable functions).


write(int, const void *, size_t);

void my_output_routine(char *string)
size_t length;

for (length = 0; *(string+length); ++length);

writes the given string to stdout (in Unix or Linux, given a unix compatable
runtime library).

Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')

All times are GMT. The time now is 04:24 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.