1. RE: contest questions

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.

new topic     » topic index » view message » categorize

2. RE: contest questions

Robert Craig wrote:
> 
> It should be possible to run your program
> from a command line, such as:
> 
>         ex yourprog < english.txt > coded.txt

This isn't working for me in Win2K. When I use that command line, I 
should be able to read english.txt with just gets(0), right?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu