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
Write programs for String Reversal & Palindrome check
Is register a keyword in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What is meant by high-order and low-order bytes?
I need a sort of an approximate strcmp routine?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What are the different categories of functions in c?
how to introdu5ce my self in serco
What does == mean in texting?
Explain what’s a signal? Explain what do I use signals for?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Explain what is the difference between null and nul?
What is an identifier?
Are pointers integer?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }