我一直在這裏關於ifstream的問題,所以我仍然無法閱讀簡單的文本文件。我與Visual Studio 2008年的工作 這裏是我的代碼: // CPPFileIO.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include <
當出現單詞「同義詞」時,我想停止閱讀我的文本輸入文件。我正在使用ifstream,我不知道如何打破循環。我嘗試使用stringstream「同義詞」,但它結束了我的bst。如果您想避免打字,我會在下面列出完整的項目文件。 重要組成部分: for(;;) /*here, I wanna break the cycle when it reads "synonyms"*/
{
在VS 2005,我有一些代碼,看起來像這樣: ifs.open("foo");
while (!ifs.eof())
{
ifs.read(&bar,sizeof(bar));
loc = ifs.tellg();
loc += bar.dwHeaderSize;
// four byte boundary padding
if ((loc