istream

    0熱度

    1回答

    我有一個小問題,我不明白。我嘗試了很多我在互聯網上閱讀的東西,但沒有任何實際的工作。 我的main.cpp代碼: #include <iostream> using namespace std; #include "Equipe.h" #include "Club.h" //PROTOTYPE void MenuSecClub(); void MenuSecFed(); int

    0熱度

    1回答

    這裏是我的代碼。(我問了一個完全不同的問題,這是不明確,標註重複,而且由於不熟悉,我編輯它,所以它看起來是一樣的,因爲這一個。對不起了點。) #include<iostream> #include<vector> using std::cin; using std::cout; using std::endl; using std::vector; int main() {

    1熱度

    1回答

    我有一個std::istream可以使用。是否有可能以某種方式將它傳遞給多個可能尋求並從不同位置讀取的讀者? 如果不是,如果我將其限制爲std::ifstream的情況怎麼辦?

    0熱度

    1回答

    我無法打印出我自己班級的矢量,vector<Data> data;。 簡單地說,我工作的一類class Data_proc,它有下公共構造函數: explicit Data_proc(const string& n, istream& is) { Data temp; while(is >> temp) this->data.push_back(temp); }

    1熱度

    2回答

    我有兩個代碼樣本之間,第一個是: //THIS CODE READS IN THE CALC.EXE BINARY INTO MEMORY BUFFER USING ISTREAM ifstream in("notepad.exe", std::ios::binary | std::ios::ate); int size = in.tellg(); char* buffer = new

    0熱度

    2回答

    istream& operator>>(istream& s, vector<Order>& ord) { string c{}; bool got_customer = false; Customer temp_customer{}; vector<Purchase>vec_purchase{}; while (s >> c) {

    1熱度

    1回答

    我正在寫一個簡單的通用分析器組合庫。這意味着庫包含許多小的函數對象,稱爲解析器,這(調用時)字符串作爲輸入,並返回ParseResults作爲輸出,其中一個ParseResult是 template <typename A> using ParseResult = std::pair<A, std::string> 名單列表爲空,如果解析器做不匹配,如果匹配,則包含單個結果,並且可能會以多種(不明

    0熱度

    3回答

    我想一個通用的,完全符合istream的「提取運算符」是這樣的: template <typename CharT, size_t N, class Traits> std::basic_istream<CharT, Traits>& operator>>( std::basic_istream<CharT, Traits>& in, std::array<CharT, N>&

    -2熱度

    2回答

    嘗試,因爲我可能,我找不到什麼cin.binary爲任何信息。 類似的,想着基地,DEC,十六進制,八進制似乎只與COUT使用時出現 - 例如, cout << std::hex << n;。 然而cout << std::binary << n;無效 進入cin.產生這種智能感知彈出 我留下假設這些都是某種標誌。當然會很高興知道,但確實。

    -3熱度

    1回答

    我新的C++和,而我是用流的工作,我看到下面的代碼: #include <iostream> #include <fstream> #include <sstream> #include <vector> #include <string> using namespace std; class Results { public: string const&