how to return 1000 variables from functio9n in c?plz give me
code also
Answer Posted / vignesh1988i
SEE /... we cant return 1000 variables at a time ... using
call by value...... only call by reference can do it....
tat is. usage of pointers...... since it will change
directly in the address itself.... that's a specality...
#include<stdio.h>
#include<conio.h>
void fun(int *,int *,int *.............1000 int's );
void main()
{
int a1,b1,c1,d1,.............a1000;
fun(&a1,&a2,...... &a1000);
for(int i=0;i<1000;i++)
printf("\n %d",a1);
getch();
}
void fun(int *a1,int *b2,.......... 1000 ptr declarations)
{
*a1=1;
*a2=2
.
.
.
.
.
.
100th varaible =1000;
}
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
How pointers are declared?
What is the purpose of clrscr () printf () and getch ()?
When should you use a type cast?
What is the difference between exit() and _exit() function in c?
What is modeling?
What is the correct code to have following output in c using nested for loop?
Is there a way to switch on strings?
Explain how are portions of a program disabled in demo versions?
What is else if ladder?
What functions are used for dynamic memory allocation in c language?
Why n++ execute faster than n+1 ?
Tell me when is a void pointer used?
How can you increase the allowable number of simultaneously open files?