Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > print output

Reply
Thread Tools

print output

 
 
aarklon@gmail.com
Guest
Posts: n/a
 
      04-09-2008
Hi all,

Is it possible to write a C program to print o/p without using library
functions( in standard C )..????
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      04-09-2008
In article <(E-Mail Removed)>,
<(E-Mail Removed)> wrote:

>Is it possible to write a C program to print o/p without using library
>functions( in standard C )..????


On -some- implementations.

There are some implementations that have memory-mapped I/O --
writing a byte to a particular address causes the byte to be sent
to I/O (e.g., to a serial port or to a printer or whatever.)

Standard C does not -promise- that there is any way to write
data to a particular absolute address, but Standard C says that
it is implementation defined as to what the meaning is of converting
an integral value into a pointer. Hence an implementation is
allowed to define the conversion of magic absolute I/O addresses
into valid pointers to write to and thus to potentially trigger I/O.

Any program that used this technique would not be portable
to any other system that did not use memory-mapped I/O, or which
used different addresses for memory-mapped I/O, or to any system
that had memory-protection that prevented users from writing to
the magic addresses -- and of course it would not be portable to
any system that basically defines the result of converting an
integral value to a pointer as creating a useless junk pointer.
But any program that used this technique successfully for
a specific system would not be violating any constraint in C.

The ability to create arbitrary pointers is fairly common in C
implementations -- the C standard doesn't promise it will work
though.

--
"There is no greater calling than to serve your fellow men.
There is no greater contribution than to help the weak.
There is no greater satisfaction than to have done it well."
-- Walter Reuther
 
Reply With Quote
 
 
 
 
Default User
Guest
Posts: n/a
 
      04-09-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Hi all,
>
> Is it possible to write a C program to print o/p without using library
> functions( in standard C )..????


Why do you want to?




Brian
 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      04-09-2008
In article <(E-Mail Removed)>,
Default User <(E-Mail Removed)> wrote:
>(E-Mail Removed) wrote:


>> Is it possible to write a C program to print o/p without using library
>> functions( in standard C )..????


>Why do you want to?


When I gave my reply earlier, I assumed that it yet another
"job interview" type question.

Now, 25 years ago, I had real reasons for wanting to know similar
information, as I was working on a multiuser 128 Mb system with no
shared libraries, and being able to omit the C library from the
(static) link meant a (relatively) major reduction in executable size.
--
"Walter is a great man." -- Dennis Green
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      04-09-2008
Walter Roberson wrote:

> In article <(E-Mail Removed)>,
> Default User <(E-Mail Removed)> wrote:
> > (E-Mail Removed) wrote:

>
> >> Is it possible to write a C program to print o/p without using

> library >> functions( in standard C )..????
>
> > Why do you want to?

>
> When I gave my reply earlier, I assumed that it yet another
> "job interview" type question.
>
> Now, 25 years ago, I had real reasons for wanting to know similar
> information, as I was working on a multiuser 128 Mb system with no
> shared libraries, and being able to omit the C library from the
> (static) link meant a (relatively) major reduction in executable size.


That's the reason for the "why?". If it's curiosity versus a real need,
then the answers may vary.




Brian
 
Reply With Quote
 
aarklon@gmail.com
Guest
Posts: n/a
 
      04-10-2008
On Apr 9, 5:24 pm, "Default User" <(E-Mail Removed)> wrote:

>
> That's the reason for the "why?". If it's curiosity versus a real need,then the answers may vary.


as walter roberson said,

When I gave my reply earlier, I assumed that it yet another
"job interview" type question.

this exactly is the reason

 
Reply With Quote
 
 
 
Reply

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
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Re: Problem - I want to print Current Output of Pdf file and shouldprint once.I get print dialog box but it is not working Lew Java 0 05-30-2007 01:31 PM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Can't print to print server =?Utf-8?B?cGVjaw==?= Wireless Networking 2 02-03-2005 02:41 PM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments