How to read data from files in Turbo c++ 4.0?

后端 未结 2 1965
时光说笑
时光说笑 2021-01-29 12:59

I am a beginner in programming and I am trying to make a code that reads 2 numbers from a file and then displays it in the output window on turbo c++. My code only reads the fi

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 13:26

    Try using infile>>x>>y inside the while loop condition like this

    while(infile>>x>>y)
    

    then use the cout statement in the loop.

提交回复
热议问题