Hello There, Guest! Login Register
Advertise Here | Remove Ads

C program to pass a single element of an array to function

  • 0 Vote(s) - 0 Average


06-17-2016, 02:14 AM #1
Shompa Offline FFU SENIOR FFU SENIOR
VIP MEMBER
Posts:2,319 Threads:222 Joined:Sep 2014 Reputation: 28 Sex Female
Code:
#include <stdio.h>
void display(int a)
{
printf("%d",a);
}
int main(){
int c={2,3,4};
display(c[2]); //Passing array element c[2] only.
return 0;
}







Forum Jump:


Users browsing this thread:1 Guest(s)

Advertise Here | Remove Ads