473,387 Members | 3,750 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,387 software developers and data experts.

can we use such function to display input without using "Prinf" ?

hi!
can we use any function to display our input

without using a " printf " function? does c support such this
possibilities?
...

Nov 20 '06 #1
6 2725
va*****@gmail.com wrote:
hi!
can we use any function to display our input

without using a " printf " function? does c support such this
possibilities?
..
Yes. Use the standard fprintf(), vprintf(), vfprintf(), puts(),
fputs(), putchar(), putc(), fputc(), or write your own.

Nov 20 '06 #2
Rg
On Nov 20, 11:23 am, "varo...@gmail.com" <varo...@gmail.comwrote:
hi!
can we use any function to display our input
without using a " printf " function? does c support such this
possibilities?
..
Standard C includes puts, fprintf, fputs, putchar and fputc which can
be used to print text into stdout or other specifi file streams.

Rg

Nov 20 '06 #3

santosh wrote:
>
Yes. Use the standard fprintf(), vprintf(), vfprintf(), puts(),
fputs(), putchar(), putc(), fputc(), or write your own.
could you show me an example using
your own function?

Nov 20 '06 #4
Je-Givara wrote:
santosh wrote:

Yes. Use the standard fprintf(), vprintf(), vfprintf(), puts(),
fputs(), putchar(), putc(), fputc(), or write your own.

could you show me an example using
your own function?
As such custom functions are usually very platform specific, it would
not be topical for this group. However, if you _really_ want to see
such code, try asking Mr. Navia nicely. He's in a very OT mood right
now. :-)

Nov 20 '06 #5
va*****@gmail.com wrote
hi!
can we use any function to display our input

without using a " printf " function? does c support such this
possibilities?
Yes, as many people know this topic is covered in detail in The C
Programming Language (2nd Edition) by Brian W. Kernighan, and Dennis
Ritchie, there is an example in the book and they explain how this
accomplished using a function.

Neil

Nov 21 '06 #6

void minprintf (char *fmt, ... )
{
va_list ap;
char *p, *sval;
int ival;
double dval;
va_start (ap, fmt);
for(p=fmt; *p;p++)
{
if (*p != '%')
{
putchar (*p);
continue;
}
switch (*++p)
{
case 'd': ival = va_arg(ap,int);
printf("%d",ival);
break;
case 'f': dval = va_arg (ap, double);
printf("%f",dval);
break;
case 's': for (sval = va_arg(ap,char *);*sval;sval++)
putchar (*sval);
break;
default: putchar(*p);
break;
}
}
va_end(ap);
}

void main()
{
.....
}

so this a code and what shall we write in the Main program?

Dec 1 '06 #7

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

Similar topics

11
by: Mark Schneider | last post by:
I'm trying to avoid using <table> for formatting purposes where other, reasonable means exist. I'm stuck trying to find a way to find an equivalent for the code below. <table align="center">...
1
by: bborden | last post by:
Novice Access programmer here. I would like to display an image using the Toolbox Image object by calling the images file name using: =fPictureFiles(!!,1) in the Picture control. Below...
6
by: LaBird | last post by:
Dear all, I would like to ask if there is any C function that accept one keystroke as input, without printing out what the user presses and without the need to press enter as delimiter....
7
by: mg | last post by:
I need to first open WebForm2 from WebForm1 and then close WebForm1 without the end user having to press an OK button before the close can occur. For example, possibly ...
30
by: ceeques | last post by:
Hi I am a novice in C. Could you guys help me solve this problem - I need to convert integer(and /short) to string without using sprintf (I dont have standard libray stdio.h). for...
7
by: PRESENT321 | last post by:
I have a form that appears several times on a page, and would rather not assign IDs. Is there a way to have my validation function focus() a text input without IDs? www.osbornewood.com Search...
13
by: ragav | last post by:
How can i print anything without using printf( ) or anyother inbuilt function calls??
10
by: patelxxx | last post by:
Problem: I am trying to input my name in a text box and I click on transfer and I want the name to appear on the same page (i.e. in another form). How is this done? <BODY> <HTML> <form...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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.