a) ios:ut is ios::ut.
b) you can't write to an input file stream. use an output file stream.