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
In which language linux is written?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
Is c object oriented?
How can I discover how many arguments a function was actually called with?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
How can you read a directory in a C program?
What is a program flowchart?
What is I ++ in c programming?
Where are c variables stored in memory?
What happens if header file is included twice?
What is a const pointer in c?
What is cohesion and coupling in c?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Why is main function so important?
What does the error 'Null Pointer Assignment' mean and what causes this error?