I am new to C programming. I am taking a class where I have to:
The program will take all input from standard input, possibly transform it, and output it to standard output.
The program will read in input line by line. Transformations, if any, will be done per line. Then print out the transformed line.
You will have to read from the user until there is no more text left. Ctrl+D can be typed into the terminal to indicate there is no text left.
I am not a student who is looking for the answer to be done for me, but I am completely lost here. I tried to use:
char*buf = NULL;
while (fscanf(stdin, "%ms", &buf) > 0)
{ do transform }
but I have no luck. So any help is appreciated. Also I have no idea about the Ctrl+D part.