How to pass array to function by reference
I have one array with value I want to pass the content of array to function by reference (pointer). I do not understand how to do that
Code:
#include <stdio.h>
#define Y '0'
#define N '1'
#define A '0'
char MyFunction(char text, int i, char *buffer); /* Prototype */
char MyFunction( char text ) /* Called function definition */
{
if (text == A)
{
//store content here//
printf("success \n");
return Y;
}
else
{
printf("Failure \n");
return N;
}
}
int main( void ) /* Calling function */
{
int size = 10;
char name[size] = {'L','e','s','s','o','n','s','\0'};
char function = MyFunction(A, size, name);
printf("%c\n", function);
return 0;
}