Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!maxwell!raghu From: raghu@maxwell.Concordia.CA ( RAGHU PRASAD CHALASANI ) Newsgroups: comp.lang.c++ Subject: Help: input/output thru' command line parameters Keywords: input, output, files Message-ID: <2530@clyde.concordia.ca> Date: 30 Nov 90 22:16:46 GMT Sender: usenet@clyde.concordia.ca Lines: 34 I am new to c++, though I've been using c for a long time. In C, one can use command line parameters to specify whether input is taken from a input file or from the std. terminal. one would typically do it as: main ( int argc, char *argv []) { FILE *fin, *fout, *fopen (); if (argc == 1) { fin = stdin; fout = stdout; } else { fin = fopen (*++argv, "r"); fout = fopen (*++argv, "w"); } . . then to read input fscanf (fin, "...", ..); } I donot want to use fscanf or fprintf in c++. So is there a similar way (or better way) of doing it using 'cout' and 'cin' in c++. please send me email as i don't read this very often. thanks raghu email: raghu@davinci.concordia.ca