473,396 Members | 1,849 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,396 software developers and data experts.

pgm without std library functions

hi,
is it possible to write a program to read and print a number without
using standard library functions in C and C++?
if yes ....how?
waiting for a reply...

Apr 7 '06 #1
12 2592
Letsee++ wrote:
hi,
is it possible to write a program to read and print a number without
using standard library functions in C and C++?


Define "read" and "print".

The answer is probably no.

Why would you not want to use the standard library? It's really quite
useful, and, err... part of the standard for a reason.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Apr 7 '06 #2
Letsee++ wrote:
hi,
is it possible to write a program to read and print a number without
using standard library functions in C and C++?
if yes ....how?


The answer is a definite "maybe". Many platforms offer other, non-standard,
functions that could be used for this. On some, you might even be able to
do some specific hackery to access the hardware directly.

Apr 7 '06 #3
"Letsee++" writes:
is it possible to write a program to read and print a number without
using standard library functions in C and C++?
if yes ....how?


You could certainly do it on machines in the DOS era. I can't remember all
the buzz words, x86 comes to mind. You could communicate with the OS via a
kind of back door. I suspect if one were clever enough you might still be
able to do something. I wrote a routine to print (on a *printer*) that
still worked with Windows 98 using these techniques I am thinking of -- I
haven't used it lately. This avoided the heavily burdened GUI way of
printing, so it actually served a purpose. You could do printing
concurrently with program execution is a Windows program (which a "console"
program is).

Consider also what you might do with the system() function.
Apr 7 '06 #4
This question was asked in an IT fest in my college...they asked us to
write a pgm without using std library functions..even if i failed to
develop it ,i want to know how it can be acheived and i have asked many
of my frnds and seniors ,but havent got the answer...
plz help...

Apr 7 '06 #5
Letsee++ wrote:
hi,
is it possible to write a program to read and print a number without
using standard library functions in C and C++?
if yes ....how?
waiting for a reply...


Not portable... but...

you could <shudder>use DOS.</shudder> Use _asm to call int 21.

Or just use a non standard library, there are many. ;)

Thomas Ritter

Apr 7 '06 #6
Letsee++ wrote:
hi,
is it possible to write a program to read and print a number without
using standard library functions in C and C++?
if yes ....how?
waiting for a reply...


If somehow you can get access to keyboard input and manipulate screen
drawing then the answer is yes.

Ben
Apr 7 '06 #7
Letsee++ wrote:
This question was asked in an IT fest in my college...they asked us to
write a pgm without using std library functions..
Well, you can write a program without any libraries, but it won't be able to
do much.
even if i failed to develop it ,i want to know how it can be acheived and
i have asked many of my frnds and seniors ,but havent got the answer...


Was that supposed to be about standard C++ or some system specific
implementation/dialect of C++? In standard C++, there is simply no way.

Apr 7 '06 #8
can anyone illustrate a simple C program for this???

Apr 7 '06 #9
Letsee++ wrote:
can anyone illustrate a simple C program for this???


Please post C questions to "comp.lang.c".

Apr 7 '06 #10
Victor Bazarov wrote:
Letsee++ wrote:
can anyone illustrate a simple C program for this???


Please post C questions to "comp.lang.c".


No! Only questions about standard C go there, and the OP's request can't be
fulfilled in standard C, just like it can't in standard C++.

Apr 7 '06 #11

Letsee++ wrote:
hi,
is it possible to write a program to read and print a number without
using standard library functions in C and C++?
if yes ....how?
waiting for a reply...


Yes. The way how is platform dependant. As the std library does such
things it is of course always possible to write your own version that
also does. However, such discussion is not topical for this group.
Try one having to do with the target platform.

Apr 7 '06 #12
you will have to use system calls .. read and write
i dont remember the syntax ..write(STDOUT,buf,..);
look for it.

Apr 7 '06 #13

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

Similar topics

3
by: Greg Bryant | last post by:
I'm doing some work for a company that has an auction site running in coldfusion. They're not real happy with it, and it needs a major overhaul, so I'm looking at redoing it, and while I'm at it,...
9
by: Hunter Hou | last post by:
Folks, I am just curious why standard library doesn't provide a "merge" operation without sorting, because sometimes I don't require sorting, just merge. I looked at list.merge() and merge()...
17
by: theDever | last post by:
hi .. I was used VB, Java, PHP and C# to developed my own software , but now I have a project in C++ , and I'm a bit confused ... In PHP,C# and Java , there are a framework that provide a wide...
19
by: Deniz Bahar | last post by:
Hi, I would like to call one of my functions the exact name as an existing C library function (for example K&R2 exercises asks me to make an atof function). If I don't include the header with...
37
by: Rajesh | last post by:
I was informed tht $SUBJECT was asked in M$ interview. Real imp. is no. of ways to achive it. mine sol. was.... int main() { if(printf("foo")) { ; } else { ; }
3
by: Jacek Dziedzic | last post by:
Hello! Suppose I'm writing a library to write a binary representation of some data to a stream. Let's say that to make it extensible in the future I'm preceding the actual data with some info...
5
by: Gerald | last post by:
Recently, my program need to be run in embeded enviroment, and I cann't use standard library. But I need to use arctan(x), so I implement it like the following: inline double pow(double x,...
13
by: robinsonreyna | last post by:
Hi everyone Is it possible to write a program which do not have a main() function. The program should compile and run. Please give sample code to do this.
18
by: Anjana | last post by:
hi, can anyone illustrate a program to read and print a number without using standard library functions?? waiting for reply....
20
by: J de Boyne Pollard | last post by:
MThe library functions which are included to allow process Mlaunch, forking, and termination, imply that it is both Mpossible and desirable for a process to fork itself. This is Ma fundamental...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.