473,549 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2608
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

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

Similar topics

3
8580
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, might as well move to PHP (for a variety of reasons - not trying to reopen the PHP -vs- CFM thing again :). Anyway, so I'm looking at this...
9
2534
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() algorithm, both require sorted sequenece. Thanks, Hunter
17
5444
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 range of functions and utilities ( like networking functions, XML parsing, RegExp ..etc )so I want to ask you people , how could you develop a...
19
2488
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 the declaration for the C library function (stdlib.h in this case) then define/declare my own function with the same name, am I safe? It seems to...
37
1981
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
1642
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 like the number of fields, total length, etc. that make up some kind of header, assuming the actual data may change over time. I was hoping to...
5
16893
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, size_t n) { if (n == 0) return 1; else if (n % 2 == 0) return pow(x * x, n >> 1); else
13
2427
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
395
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
3498
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 part of the Unix thought process, but is Mnot essential for a working OS. There are no Standard C Library functions for process forking or...
0
7472
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7743
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7832
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5391
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1083
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.