Search
 
SCRIPT & CODE EXAMPLE
 

C

Call by reference to pass an array to the function in C-

#include <stdio.h>
void display( int *powers)
{
printf("%d ", *powers);
}
int main()
{
printf("Welcome to Dataflair tutorials!

");
int i;
int array[] = {1, 2, 4, 9, 25, 36, 49, 64, 81, 100};
for (i=0; i<10; i++)
{
display(&array[i]); // Passing the address of array to the function
}
return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: C how to find substring in string 
C :: c concatenate strings 
C :: nested loop in c 
C :: block a website on mac 
C :: how to print a file c 
C :: concatenate char * c 
C :: nested switch case in c 
C :: divide and conquer program in c 
C :: Futter Square Button 
C :: addition in c 
C :: c program strtok use 
C :: pthread c 
C :: function for calculate the average and standard deviation of table 
C :: strcmp c 
C :: copy string in c 
C :: arduino wifi client 
C :: int to char in c 
C :: prime factorization of factorials using c 
C :: c round float 
C :: Program to input and print array elements in c 
C :: c bits 
C :: rust cross compile 
C :: passing file as argument in c 
C :: C program to input the month number and output the month name using switch statement 
C :: sleep in c 
C :: how to use pointer in c to print char 
C :: c unused parameter 
C :: objects in oops 
C :: How to send an array through a pipe 
C :: how to check file pointers in c 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =