As the title suggests I have to make a program to emulate the CAT commands, so far I have got basic input and output working however I need now include options such as -n.....
while((rd = getchar()) != EOF){
if(putchar(rd) == EOF){
perror("Write Err");
return EXIT_FAILURE
}
}
return EXIT_SUCCESS;
Whats the best way to go about printing options such as numbered lines or dollar signs to the actual output ?? Should I change my I/O methods to fgets
and fputs
(so I can then print out numbered lines, in a string format with the original input) Also should I use malloc realloc since there is no definite size of users input?