473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

print output

Hi all,

Is it possible to write a C program to print o/p without using library
functions( in standard C )..????
Apr 9 '08 #1
2 1298
In article <3e**********************************@u12g2000prd. googlegroups.com>,
<aa*****@gmail.comwrote:
>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
Apr 9 '08 #2
aa*****@gmail.com 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
Apr 9 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bertram Scharpf | last post by:
Hi, when I write >>> print 'abc', 'def', >>> print 'ghi' I get the output 'abc def ghi\n'. Is there a way to manipulate the print
30
by: Martin Bless | last post by:
Why can't we have an additional 'print' statement, that behaves exactly like 'print' but doesn't insert that damn blank between two arguments? Could be called 'printn' or 'prin1' or 'prinn'...
12
by: Michael Foord | last post by:
Here's a little oddity with 'print' being a reserved word... >>> class thing: pass >>> something = thing() >>> something.print = 3 SyntaxError: invalid syntax >>> print something.__dict__...
0
by: David Bolen | last post by:
I ran into this strange behavior when noticing some missing spaces in some debugging output. It seems that somewhere in the print processing, there is special handling for string contents that...
14
by: Marcin Ciura | last post by:
Here is a pre-PEP about print that I wrote recently. Please let me know what is the community's opinion on it. Cheers, Marcin PEP: XXX Title: Print Without Intervening Space Version:...
4
by: Shailesh | last post by:
Hi! I want to overload << operator so that it can print an arry defined in MyClass.My problem is that I want to print only a no of elements NOT all the elements in the array and this no of...
16
by: John Baker | last post by:
HI; I feel like a fool..I put CUTE FTP in my last request for help --it should have been CUTE PDF! I have FTP on my mind because I have been working on a web based application, and somehow my...
3
by: James J. Besemer | last post by:
I would like to champion a proposed enhancement to Python. I describe the basic idea below, in order to gage community interest. Right now, it's only an idea, and I'm sure there's room for...
2
by: Phoe6 | last post by:
print and softspace in python In python, whenever you use >>>print statement it will append a newline by default. If you don't want newline to be appended, you got use a comma at the end (>>>print...
6
by: Greg Esres | last post by:
I have some text lines to print that are much longer than the width of the paper, maybe as much as 6 times. For a given page, I'd like everything that doesn't fit to print on a second page, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.