how to return a multiple value from a function?

Answers were Sorted based on User's Feedback



how to return a multiple value from a function?..

Answer / tanish

Use an array
int [] funct1();

Is This Answer Correct ?    3 Yes 0 No

how to return a multiple value from a function?..

Answer / krishna

You will have to use a structure or an array and then return
a pointer to the structure/array.

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Code Interview Questions

# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }

1 Answers  


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  


Implement a t9 mobile dictionary. (Give code with explanation )

1 Answers   Amazon, Peak6, Yahoo,


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers   CSC,


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

3 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  


void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }

1 Answers  


what is the output of the below program & why ? #include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); }

6 Answers   CSC, IIIT,


What is "far" and "near" pointers in "c"...?

3 Answers  


Is the following code legal? struct a { int x; struct a b; }

1 Answers  


main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O

4 Answers   HCL,


Categories