473,320 Members | 2,193 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,320 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 2589
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.