Originally Posted by
stahta01
Code:
char MyFunction(char text, int i, char *buffer); /* Prototype */
char MyFunction( char text ) /* Called function definition */
Lying to the compiler ends badly!
You said MyFunction has 3 parameters and then then you used only one in the function body.
Tim S.
my typing mistake
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, int i, char *buffer);
{
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;
}