Hi peeps
Can anyone tell me what must be a fairly standard incantation?
About a decade ago I wrote
inputStream is NULL unless a filename has been specified on the command line. The attach() function that was available with that compiler allowed me to use this program as part of a pipeline.Code:ifstream fin; if (NULL == inputStream) { fin.attach(0); inputStream = "stdin"; } else { fin.open(inputStream, ios::in); }
orCode:who -a | sortByDate
I haven't really used C++ since then and the attach() function seems to have been an extension that isn't available today. I can't simply doCode:sortByDate uuu.txtcan I?Code:fin = cin