hi!
can we use any function to display our input
without using a " printf " function? does c support such this
possibilities?
... 6 2736 va*****@gmail.c om 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.
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
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?
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. :-) va*****@gmail.c om 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
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",iva l);
break;
case 'f': dval = va_arg (ap, double);
printf("%f",dva l);
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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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">
<tr>
<td>abc</td>
</tr>
</table>
|
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 is the function which DOES actually returns a valid file
|
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. getchar()
can accept a character, but it needs user to press enter to
accept the input.
Thanks very much.
|
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
Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');</script>")
Is there code that will accomplish this without using 3rd-
|
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 instance:-
int i =2;
char ch 'A'
| |
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 form in the upper right corner.
Thanks,
Matthew
|
by: ragav |
last post by:
How can i print anything without using printf( ) or anyother inbuilt
function calls??
|
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 id="form1", action="testing.htm" method="post">
Your name: <input type="text" name="name"/>
</form>
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |