Hello,
For the following code snipet:
(1) executes but then the program immediately jumps to (5). (2) and (4) are printed on the same line. What's wrong?Code:char src, dst[20]; while(1) { printf("Source host: "); scanf("%c", &src); // (1) printf("Destination IP address: "); // (2) fflush(stdout); fgets(dst, sizeof(dst), stdin); // (3) *strchr(dst, '\n') = 0; strcpy(user_input.dst, dst); printf("Don't fragement (0, 1)? "); (4) scanf("%i", &user_input.df); // (5)
Thanks