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

How to implement variable argument functions ?

Answer Posted / swetcha

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 ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who is the founder of c language?

1161


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1118


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3240


Where static variables are stored in c?

1105


What is difference between class and structure?

1114


What is the use of header files?

1101


What is c language & why it is used?

1103


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

2179


Explain how can you tell whether a program was compiled using c versus c++?

1099


What is nested structure in c?

1058


What is a memory leak? How to avoid it?

1330


What are the rules for the identifier?

1158


What is the use of bitwise operator?

1121


What is chain pointer in c?

1058


What are the different properties of variable number of arguments?

1151