ifstream

    0熱度

    3回答

    我想讓行標記//此行應該打印做它的事情,這是打印「同義詞」和「反義詞」之間的int值。 這是文本文件: dictionary.txt 1 cute 2 hello 3 ugly 4 easy 5 difficult 6 tired 7 beautiful synonyms 1 7 7 1 antonyms 1 3 3 1 7 4 5 5 4 7 3 #i

    3熱度

    1回答

    說我這樣做(一個人爲的例子): #include <iostream> #include <fstream> using namespace std; int main(int argc, char* argv[]) { ifstream ifs(argv[1]); char ch; while(ifs.read(&ch, 1)) { cou

    1熱度

    3回答

    當出現單詞「同義詞」時,我想停止閱讀我的文本輸入文件。我正在使用ifstream,我不知道如何打破循環。我嘗試使用stringstream「同義詞」,但它結束了我的bst。如果您想避免打字,我會在下面列出完整的項目文件。 重要組成部分: for(;;) /*here, I wanna break the cycle when it reads "synonyms"*/ {