ifstream
Getting the nth line of a text file in C++
I need to read the nth line of a text file (e.g. textfile.findline(0) would find the first line of the text file loaded with ifstream textfile). Is this possible?[详细]
2023-04-01 02:54 分类:问答stream .pdf error [duplicate]
This question already has an answer here: Closed 11 years ago. Possible Duplicate: convert a file (.txt,.pdf..) into a stream file[详细]
2023-03-31 06:24 分类:问答Cannot read input file ifstream
I\'m trying to read an input file formatted with two numbers on a l开发者_运维百科ine and store the first number in the line in one vector and the second number in another vector.[详细]
2023-03-22 10:52 分类:问答Can't write the last part of a txt file to cout using ifstream
The code below will print开发者_如何学运维 all of the text from the sample text file I\'m using except for the last little snippet of it.I think this has something to do with the eof or the byte size[详细]
2023-03-21 09:32 分类:问答eof error reading pieces of text file and writing to boost.asio socket
I\'m trying to read a file 1kB at a time and write each piece of data to a socket using boost.asio.The problem is that when I need to read the last piece of data from the text file and put it in the b[详细]
2023-03-21 00:04 分类:问答getline() error
I am writing this function that copies the contents of one file into the other. I am using getline() function in my while loop. Somehow, compiler gives me an error. Do you know why?[详细]
2023-03-20 01:10 分类:问答C++ ifstream::read() and C arrays
It seems to be a general consensus that C arrays are bad and that using the smarter alternatives, like vectors or C++ strings is the way to 开发者_StackOverflow中文版go. No problem here.[详细]
2023-03-19 13:22 分类:问答ifstream not reading EOF character
I am creating a program (In C++) that takes an ASCII file and reads a few values from each line until it reaches the end of the file.I am using ifstream to read the file, and I have never had problems[详细]
2023-03-15 20:47 分类:问答Proper choice of file stream objects
Application uses RapidXML to edit XML file. Editing is not automated and takes place occasionally: XML content is displayed in GUI and user performs some actions which change XML. Each change must be[详细]
2023-03-14 16:16 分类:问答How to delete parts from a binary file in C++
I would like to delete parts from a binary file, using C++. The binary file is about about 5-10 MB. What I would like to do:[详细]
2023-03-14 15:43 分类:问答