ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
How to implement variable argument functions ?
 Question Submitted By :: Leossk
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to implement variable argument functions ?
Answer
# 1
Variable-argument functions in C are inherently unsafe 
since there is no language-level mechanism to ensure that 
the actual arguments agree in type and number with the 
arguments that the function will be using. There are 
several ways to implement variable argument functions in C

You can try to implement such function by taking the 
address of a formal argument and working your way through 
the stack frame.A better alternative is to use the 
__builtin_next_arg function on gcc and then work your way 
up the stack. You can write your variable argument 
functions using the standard macros in <stdarg.h> and 
<vararg.h>.  
 
Is This Answer Correct ?    2 Yes 1 No
Swetcha
[Semanticspace]
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Switch (i) i=1; case 1 i++; case 2 ++i; break; case 3 --i; Output of i after executing the program Mascot4
how can i make a program with this kind of output.. Enter a number: 5 0 01 012 0123 01234 012345 01234 0123 012 01 0 Wipro4
find largest element in array w/o using sorting techniques. Zycus-Infotech2
11. Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage Accenture7
How to set a variable in the environment list?  1
char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable) Mascot6
fun(int x) { if(x > 0) fun(x/2); printf("%d", x); } above function is called as: fun(10); what will it print? } NDS13
let's take a code struct FAQ { int a; char b; float c; double d; int a[10]; }*temp; now explain me how the memory will be allocated for the structure FAQ and what address will be in the structure pointer (temp)....................  7
who will call your main function in c under linux?  2
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}  3
what is difference between array of characters and string Accenture10
Explain following declaration int *P(void); and int (*p)(char *a);  2
what is the output of the following program? main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }  7
What is the difference between char a[] = "string"; and char *p = "string"; ? Honeywell11
Difference between null pointer and dangling pointer? Wipro3
what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }  4
I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.  1
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } what will happen if you executed this code? Ramco4
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?  4
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?  6
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com