I am studying C my self and trying to do some exercise.
The exercise requires 2 functions, one to takes three parameters (one string holds questions, one string holds user 's answers, and one integer limits the characters of the answer. The other function is the main function that uses the previous function to ask the user and prints the full name.
I also tried to write the code but there is a problem which I can not find it out by myself. Can any one show me the mistake and explain it for me ?
#define SIZE 100
void func(char, char, int);
char str1 = "Enter your first name: ";
char str2 = "Enter your middle name: ";
char str3 = "Enter your last name: ";
func(str1, answer, SIZE);
func(str2, answer, SIZE);
func(str3, answer, SIZE);
printf("Your full name is: %s", answer);
void func(char *a, char *b, int max_size)
i = strlen(temp);
if(i < max_size)
printf("You enter too much characters.");