I usually use these two lines of code:

freopen_s("input.txt", "r", stdin);
freopen_s("out.txt", "w", stdout);

but you have to make sure the input file has the name "input.txt" and
is in the smae directory as the built program.
The output file will be created when you run the program
automatically, but if a file with that name exists, it is overwritten.

On Apr 12, 2:51 pm, K21G <[email protected]> wrote:
> anybody please help me in file input in c++.....i had tried a lot of
> code but still unable to input correctly...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to