I have a question just knowledge and any suggestions to my code would be appreciated. So what I have below is a user enter input and the the plan is to have the string go through a validation method. I was just printing out the size/length to see what Im looking at when I pass my array through the parameter. My questions are why does sizeof() always give me the output of 4, and strlen gives me the number of character + 1 (what is the plus one). Thank You.
#include <stdio.h>
#include <stdbool.h>
bool validate(char *s);
int main()
{
char *input[15];
printf("Enter your desired input: ");
fgets(input, sizeof(input), stdin);
validate(input);
return 0;
}
bool validate(char *s)
{
printf("the size of %s is %d and the length is %d\n\n", s, sizeof(s), strlen(s));
}