What is the purpose of sizeof? When I delete the sizeof it shows the error about IntelliSense: argument of type "char *" is incompatible with parameter of type "int" but the program still can run.
Code:#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char buf[20]; char *a; printf ("Please enter a line of text, max %d characters\n", buf); fgets(buf, buf, stdin); a = strchr(buf, '\n'); *a= '\0'; printf ("Thank you, you entered >%s<\n", buf); system("pause"); }