私はC++で1行ずつテキストファイルを読みます。 「...ここになど長いのです」行ごとにtxtを読む
-------
This file is a test to see
how we can reverse the words
on one line.
Let's see how it works.
Here's a long one with a quote from The Autumn of the Patriarch. Let's see if I can say it all in one breath and if your program can read it all at once:
Another line at the end just to test.
-------
問題は、私は読むことができている唯一の段落で始まる、それが停止します。これは、テキストファイルである
while (inFile)
{
getline(inFile,oneLine);
}
:私はこのコードを使用しています"すぐに:" すべてのテキストを読むために解決できませんでした。提案はありますか?
あなたはあなたが1行を読むたびに 'oneLine'の内容を上書きしているので、whileループが終了した後の' oneLine'中の唯一の内容は最後の行です。 – PeterT
あなたは本当にたくさんのコードを含んでいませんでした... – DilithiumMatrix