Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Printf can be implemented by using __________ list.

Answers were Sorted based on User's Feedback



Printf can be implemented by using __________ list...

Answer / susie

Answer :

Variable length argument lists

Is This Answer Correct ?    17 Yes 1 No

Printf can be implemented by using __________ list...

Answer / sagar arora

variable length argument lists,for more information checked
out in Dennis Ritchie book.u can write ur own printf.

Is This Answer Correct ?    6 Yes 1 No

Printf can be implemented by using __________ list...

Answer / navneet

using Variable length argument lists :
Let us see how

Use vprintf, vfprintf, or vsprintf.

Here is an "error" routine which prints an error message, preceded by the string "error: " and terminated with a newline:

#include <stdio.h>
#include <stdarg.h>

void
error(char *fmt, ...)
{
va_list argp;
fprintf(stderr, "error: ");
va_start(argp, fmt);
vfprintf(stderr, fmt, argp);
va_end(argp);
fprintf(stderr, "\n");
}
To use the older <varargs.h> package, instead of <stdarg.h>, change the function header to:

void error(va_alist)
va_dcl
{
char *fmt;
change the va_start line to

va_start(argp);
and add the line

fmt = va_arg(argp, char *);
between the calls to va_start and vfprintf. (Note that there is no semicolon after va_dcl.)

References: K&R II Sec. 8.3 p. 174, Sec. B1.2 p. 245; H&S Sec. 17.12 p. 337; ANSI Secs. 4.9.6.7, 4.9.6.8, 4.9.6.9 .

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

13 Answers   Intel, Microsoft, TCS,


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??

1 Answers  


Find the largest number in a binary tree

7 Answers   Infosys,


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }

1 Answers  


void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }

3 Answers   Cisco, HCL,


char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

1 Answers  


Categories