I have this but once it reaches the supposed EOF it just repeats the loop and scanf again.
int main(void) { char words[16]; while(scanf("%15s", words) == 1) printf("%s\n", words); return 0; }
Related Posts:
- Simple C scanf does not work? [duplicate]
- Reading float using scanf in c
- Reading float using scanf in c
- What is EOF in the C programming language?
- What is EOF in the C programming language?
- Difference between scanf() and fgets()
- Going through a text file line by line in C
- Reading a string with scanf
- Going through a text file line by line in C
- How to do scanf for single char in C
- How to use EOF to run through a text file in C?
- How to print an unsigned char in C?
- Scanning Multiple inputs from one line using scanf
- How do you allow spaces to be entered using scanf?
- Difference between fgets and fscanf?
- how use EOF stdin in C
- How to find EOF through fscanf?
- How to repeat a char using printf?
- Reading in double values with scanf in c
- Representing EOF in C code?
- Reaching EOF with fgets
- How to read from input until newline is found using scanf()?
- Arrow operator (->) usage in C
- typedef struct vs struct definitions [duplicate]
- Floating point exception( core dump
- Why am I getting “void value not ignored as it ought to be”?
- 1 = false and 0 = true?
- What is an unsigned char?
- char *array and char array[]
- Get a substring of a char*
- What does #pragma once mean in C? [duplicate]
- Printing hexadecimal characters in C
- What is the difference between const int*, const int * const, and int const *?
- Connect: Socket operation on non-socket
- C library function to perform sort
- what is stack smashing (C)?
- “Initializer element is not constant” in C
- How do you do exponentiation in C?
- Printing long int value in C
- Try catch statements in C
- How I can print to stderr in C?
- How do I create an array of strings in C?
- How to check if a string is a number?
- The difference between stdout and STDOUT_FILENO
- Convert Python program to C/C++ code?
- What does ** do in C language?
- Is “argv[0] = name-of-executable” an accepted standard or just a common convention?
- What’s the difference between a file descriptor and file pointer?
- How do you pass a function as a parameter in C?
- Cygwin – Makefile-error: recipe for target `main.o’ failed
- Why am I getting “undefined reference to sqrt” error even though I include math.h header?
- Why am I getting “undefined reference to sqrt” error even though I include math.h header?
- warning: control reaches end of non-void function [-Wreturn-type]
- gcc/g++: “No such file or directory”
- Expected declaration specifier error in function
- Multiple definition of … linker error
- Does sizeof return the number of bytes or the number of octets of a type in C?
- “…redeclared as different kind of symbol”?
- Bind failed: Address already in use
- What is the perfect counterpart in Python for “while not EOF”
- What does “Permission denied” “Id returned 1 exit status” mean?
- Memory Clobbering Error
- How to pass 2D array (matrix) in a function in C?
- malloc: *** error: incorrect checksum for freed object – object was probably modified after being freed
- What is the difference between object-oriented languages and non object-oriented languages?
- Check if input is integer type in C
- C: using strtol endptr is never NULL, cannot check if value is integer only?
- cast to pointer from integer of different size, pthread code
- double free or corruption (!prev) error in c program
- Where to find the complete definition of off_t type?
- struct has no member named
- Valgrind Invalid free() / delete / delete[] / realloc() in C
- printf not printing to screen
- What does this GCC error “… relocation truncated to fit…” mean?
- Two or more data types in declaration specifiers error
- ‘sprintf’: double precision in C
- C printing bits
- How do I find the time complexity (Big O) of while loop?
- Why do we use NULL in strtok()?
- How to convert string to float?
- C char array initialization
- Is there a standard sign function (signum, sgn) in C/C++?
- Two decimal places using printf( )
- getline() vs. fgets(): Control memory allocation
- Library for the Basic Data Structures, such as Queue, in C
- How to run C program on Mac OS X using Terminal?
- Using sys/socket.h functions on windows
- Segmentation fault- strcat
- Difference between exec, execvp, execl, execv?
- How to format strings using printf() to get equal length in the output
- Example of waitpid() in use?
- Can a function return two values?
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- How to know what the ‘errno’ means?
- Printf was not declared in this scope
- How to free memory from char array in C
- Can I get Unix’s pthread.h to compile in Windows?
- Initializing 2D char array in C
- Convert Char to String in C
- How to print a int64_t type in C