RE: contest questions
- Posted by "C. K. Lester" <cklester at yahoo.com> Mar 02, 2002
- 438 views
Robert Craig wrote: > > > For the contests, what is "standard input?" > > It's file number 0. > i.e. your program should read from file 0, > using for example, getc(0) or gets(0), Don't I have to do a fn = open(thefile,"r") and then use fn for input: nextLine = gets(fn) Why would I hardcode the '0'? nextLine = gets(0) > It should be possible to run your program > from a command line, such as: > > ex yourprog < english.txt > coded.txt Can I allow the user to just do this: ex yourprog words and then yourprog loads up words & ".txt" or something? > Without the "<" on the command-line > it would be, but I'm not going to test it that way. So, "<" becomes standard input?! Like when I do nextLine = gets(0) it's going to read from the file after the "<"? OIC. So the first file is file 0 and the second is file 1...? > I'm not sure what you are driving at, > but the cipher line could be any random shuffling > of the letters A to Z, with no duplicate letters. That's what I was driving at... thanks.