#include
#include
#include
using namespace std;
Struct node
{string data.
The string word;
The string sign;
//the string name; Struct node * next;
};
//set up by the head pointer has n nodes linked list, head for the reference parameters,
//in order to make the argument for the corresponding list header pointer
Void creat (node * & amp; The head, int n)
{if (n & lt; 0 {cout & lt; <"The value of n is invalid" & lt;
cout<" Enter a character "& lt;
cout<" Enter a character "& lt;
cout
}
Void the save (node * & amp; Head)//function name is the modified
{
Node * p; Ofstream file (" yourinfo. TXT ", the ios: : app);//open the file file & lt;
Void readfile ()//read data in a file
{
Rear head node * and * and * G;
The head=new node;
G=new node;
Rear=head;
Ifstream read (" yourinfo. TXT ");
if(! Read)
{
cout<" Failed to read file!!!!! "& lt;
The exit (1);
}
While (read> Setw (10) & gt;> G - & gt; Data> Setw (10) & gt;> G - & gt; Word> Setw (10) & gt;> G - & gt; Sign)
{
G=new node;
Rear - & gt; Next=G;
Rear=G;
Read> Setw (10) & gt;> G - & gt; Data> Setw (10) & gt;> G - & gt; Word> Setw (10) & gt;> G - & gt; Sign;
}
Rear - & gt; Next=NULL;
Read. The close ();
}
Int main ()
{cout & lt; <"Need how many sets of data storage & lt;"
CodePudding user response:
Read and write need one to one correspondenceCodePudding user response: