I am not allowed to call any function other in a C library other than scanf
, printf
, and feof
.
When I try to use the code below, it only reads a file up to space char. Is there a way to read a whole line without using "%[^\n]"
?
My end goal is to read the entire file using feof
file but first, I need to know how to read a line using scanf
. Is it possible?
#include <stdio.h>
int main(){
char ar[50];
scanf("%s", ar);
printf("%s", ar);
}