-
Don't understand what you mean by startmark and enterstumark.
But wenjian <<"Student ID"<<"\t"<<"Name"<<"\t"<<"Language"<<"\t"<<"Computers"<<"\t"<<"English"<<"\t"<<"Mathematics""There must be a grammatical error in this sentence;
Because wenjian is opened in read mode, and "is a written operator.
Only objects of the ofstream class have an operator.
Got it?
-
ifstream wenjian("Grades. txt");
Grades. txt",ios::in);Open the file as written.
Change. ifstream wenjian("Grades. txt");
Or. ifstream wenjian;
Grades. txt",ios::in);Open the file as written.
-
Indeed,My opinion is the same as the 2nd floor.,The landlord should be mistaken.,The file object defined with ifstream seems to be only read.,And ofsteam can only write.,I don't understand how the landlord uses it to write and read.。
-
It seems that your program is trying to store the 010110111 number in bianma one by one, and if so, then there are several problems with this program
Files are opened in a streaming way, which means that the contents of the file depend on your program's interpretation. 010110111 to a program, it's more like a string, you read it by int, int has a range limit, after conversion, it is read as a 1011011, the first 0 is rounded, the following 1 is rounded, and the for loop is actually only read once. So at the very least, your numbers should be separated directly by spaces, i.e. :
0 1 0 1 1 0 1 1 1 1 then the for loop will be executed 9 times, reading bianma[0] bianma[8].
The read operation on the stream should generally be while(!).In this way, for is rarely used, because it is generally read to the tail of the stream, which ends naturally. Even if you want to keep counting, it's done in while.
The processing of files should be read as much as possible by string and line, and then processed, whether it is a conversion or other dump. It's safest that way. So to be unformatted, you should:
int bianma[500];
char sline[128] =0";
ifstream inf("new_");
if (!inf)
while (!
-
I would like to ask how this is compiled. x is defined in **.
-
What is the definition of this program, and that number you can see if it is outside the scope of the definition.
You save the path in an XML and read it out the next time you start it.
Understand the following rules: 1) Overloading an operator does not change the priority of the operator. >>>More
textreader reader;
int linecount = 0; >>>More
First of all, if you are wrong, if the value type is a global or static variable, it is assigned on the heap, and the local variable is allocated on the stack. The reference type is allocated on the heap, because the new comes out of the dynamically allocated memory, so both local and global are in the heap until the garbage user goes to it. In fact, memory allocation is basically the same form, and it has nothing to do with the language.
1. Books are best friends. When you encounter any difficulties in life, you can turn to it for help, and it will never turn its back on you. —Dude. >>>More