istream
Reading constant number of characters in C++
How would you read a string if it was no longer than 20 characters and could contain spaces in C++? For example I have this kind of file:[详细]
2023-04-11 01:15 分类:问答C++ stream polymorphy on stack?
I would like to do something like this: std::wistream input = std::wifstream(text); if (!input) input = std::wistringstream(text);[详细]
2023-04-10 04:05 分类:问答Reading text fields from file with custom separator
I am working on a problem for a class I\'m taking in which we need to read in text from a file to a 2d table of strings (called \'string table[][]\'). The text file I\'m reading in is formatted as fol[详细]
2023-04-08 00:18 分类:问答std::istream extraction sets failbit for no apparent reason
I\'m creating a primitive type wrapper, which can use boost::lexical_cast for setting its value from a string. It works fine, but for some reason std::istream extraction operator sets the failbit. The[详细]
2023-04-03 21:21 分类:问答istream_iterator ignoring EOF (Ctrl+D) when reading chars
I\'m trying to use istream_iterator for reading characters from cin. I\'ve read that pressing Ctrl+D sends an EOF character which ends the input stream. Unfortunately, something is going wrong with it[详细]
2023-04-03 02:16 分类:问答std::getline alternative when input line endings are mixed
I\'m trying to read in lines from a std::istream but the input may contain \'\\r\' and/or \'\\n\', so std::getline is no use.[详细]
2023-03-20 13:09 分类:问答How to send IplImage from server to iPod client UIImage via TCP
I have a server in linux using the Berkeley_sockets and I create a TCP connection with an iPod client. I have an IplImage* img; to send from the server to the iPod. I use the write(socket,/*DATA*/,432[详细]
2023-03-16 13:05 分类:问答Opening stream via function
I need help with the non-copyable nature of [io](f)streams. I need to provide a hackish wrapper around fstreams in order to handle files with unicode characters in their filenames on Windows. For thi[详细]
2023-03-16 12:04 分类:问答How to use istream with strings
I would like to read an file into a string. I am looking for different ways for how to do it efficiently.[详细]
2023-03-16 04:06 分类:问答PInvoke and IStream
I have an exported function from a dll written in c++ with the following signiture: Foo( LPSTREAM *pStream, UINT &Size )[详细]
2023-03-13 01:10 分类:问答