this is my first post. I am new to C programming (student < 3 months). While doing an assignment I keep getting an error of Segmantation Fault (core dumped) when I run my program. I have posted the section that I get this error on (the if statements work, and it only does one of the three choices... I get the same error no matter what I enter into the buffer ):

int getLine (string buffer)
{
string inputString;
int x;

printf("input string ===>");
inputString = gets(buffer);

if (*buffer == NULL || *buffer == EOF)
{
x = FALSE;
printf("buffer = %s \n",buffer); /* Here .. it prints the buffer then I get the error /*
printf("Value of x = %i",x); /*it does not print this */
return x;
}
if (strcmp (buffer,"*END*") == 0)
{
x = FALSE;
printf("buffer = %s \n",buffer); /* Here .. it prints the buffer then I get the error /*

printf("Value of x = %i",x); /*it does not print this */
return x;
}

x = TRUE;
printf("buffer = %s \n",buffer); /* Here .. it prints the buffer then I get the error /*

printf("Value of x = %i",x); /*it does not print this */
return x;
}
/* End of the getLine function */