I am not entirely clear on the difference between cerr and clog.
They only are tow different streams..
> When it is more appropriate to use one versus the other? I am coding a simple C++
application that will issue error and warning statements based on an
input, and I would like to know whether these should both go to cerr, or
whether clog for warnings is a more appropriate choice (or I suppose, just
cout)?
Yes..
Some time ago, i red an article describing the way to get the streams into
different files using windows.
I've found this:
----------------------------------------------------------------------------------------------
Redirection, Pipes and Filters
Redirection
Directing output ( > ) from a program to a specific file or device
(different from the 'standard output' device: the screen).
Directing input ( < ) to a program from a specific file or device (different
from the 'standard input' device: the keyboard).
Pipe
A data-channel ( | ) in RAM that takes output from a program and feeds the
data as input to another program.
Filter
A program that accepts input data - does something to the data - and
delivers output data.
Both input and output may be redirected or piped.
DOS filters: find, more, sort
Examples:
dir > list.txt redirect output from dir to the file list.txt
- if the file does not exist, it is created
- if the file exists, it is overwritten.
dir >> list.txt redirect and append output from dir to the file list.txt
- if the file does not exist, it is created
- if the file exists, output is appended to end of file.
sort < names.txt > list.txt use the file names.txt as input to sort
- output from sort is sent to the file list.txt.
dir | sort pipe output from dir to sort
- output from sort is sent to standard output: the screen.
dir | sort > c:\temp\list.txt - output from sort is sent to the file
c:\temp\list.txt.
dir | sort | more - output from sort is piped to more
- more (a filter) delivers output one screenfull at a time.
Redirection and pipes may be used in batch files.
-----------------------------------------------------------------------------------
but i can't remember how to split the streams... sorry
bye bye
Gnafu