How to write in a function declaration and in function call in
which the function has 'n' number of varible or arguments?
Answers were Sorted based on User's Feedback
Answer / kiran kumar yakkala
returntype function_name(int counter,...)
here first one is the counter tells about how many no are
going to use
... specifies variable no of arguments
for further clarificaiton, refer "Let us C" book
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / aravind
#include<stdio.h>
int example(int );/*function prototype*/
int main()
{
int a[4]={1,2,3,4,5},i;
example(a[0]);/*function call*/
printf("a=%d",a[i]);
}
int example(int b[k])/*function defintion*/
{
int j;
for(j=0;j<=4;j++)
printf("%d",b[j]);
}
/*here i took n=4*/
Is This Answer Correct ? | 0 Yes | 0 No |
What is the use of getch ()?
Does c have function or method?
What is the best style for code layout in c?
enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above
Is it valid to address one element beyond the end of an array?
What is the difference between the local variable and global variable in c?
Why c is procedure oriented?
Give the output for the following program. #define STYLE1 char main() { typedef char STYLE2; STYLE1 x; STYLE2 y; clrscr(); x=255; y=255; printf("%d %d\n",x,y); }
What is difference between far and near pointers?
What are the different file extensions involved when programming in C?
How do you write a program which produces its own source code as its output?
what is the use of operator ^ in C ? and how it works?