Why must pt be a pointer? Also, if pt = gets(buffer) - is that checking the return value of gets, or would that return what they actually typed?Code:#include <stdio.h>
int main()
{
char buffer[120]; /* Holds input and output strings */
char *pt; /* A pointer to datatype char */
int returnCode;
while ((pt = gets(buffer)) != NULL)
{
returnCode = puts(buffer);
if (returnCode == EOF)
{
printf("Error on output\n");
}
}
return 0;
}
Thanks