How to redirect the output of gcc compiler to a file?

Viewed 33469

Redirection operator does not work. So how should we do it? One more question, in makefile, how can we give arguments from command line, like

run: a.out
    ./a.out **<input>**
3 Answers

A detailed documentation for I/O redirection for stdout,stderr is given in this document(1).Peripheral devices like stdin(eg:keyboard), stdout(eg: computer monitor) and stderr(error messages from the output of a gcc compilation) are considered as files.

Related