im getting a cast error im not sure why im doin everthing correct i think? any idea's?
Code:
char guessType()
{
char type;
char *prompt = "Enter the type !\n";
type = getUserInput(prompt);
guessType=strtod = (type, NULL);
return type;
}
char* getUserInput(char *prompt)
{
/* declaration of variables*/
char *result;
char buff[BUFF_SIZE];
/* printing a char pointer*/
printf(prompt);
/* whatever the user has typed in*/
result = fgets(buff, BUFF_SIZE, stdin);
/* if the user types in nothing it shows an error*/
if(result == NULL)
{
printf("Error please enter the input again!\n");
}
else if(result[strlen(result)-1] != '\n')
{
readRestOfLine();
}
/* check if its used the whole buffer if so flush*/
return result;
}