— Literally just give it stdout
— I wanted a code that simply does gets(str);puts(str);
— Or simply put, rtfm
— Why are you afraid using fgets? Just give that function stdin. It also has type (FILE *) but it handles your standard input stream.
Message permanent page
That doesn't mean you have to using files, it will handle your input from "terminal" / "command prompt".
— What are the ways to optimize run time?
— What do you want to optimise?
— You mean code?
— Compile with optimization flags enabled, put unchanging values into const and constexpr
— Optimization flags mean?
— Settings for your compiler
— Depends on your compiler