I am coding a program that reads data directly from user input and was wondering how could I (without loops) read all data until EOF from standard input. I was considering using cin.get( input, '' )
but ''
is not really the EOF character, that just reads until EOF or ''
, whichever comes first.
Or is using loops the only way to do it? If so, what is the best way?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…