No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
code not working [code=c++] #include<iostream> using namespace std; typedef struct node{ int data; struct node *next; struct node *previous; }mynode; mynode *head,*temp,*current,*tail; void add(int data); int main() { head=NULL; tail=NULL; add(1); cout<<"added 1"<<endl; add(2); add(3); add(4); } void add(int data) { temp=(mynode*)malloc(sizeof(mynode)); temp->next=NULL; temp->previous=NULL; if(head == NULL) { head=temp; tail … |
|
I believe that ofstream is for writing into a file and ifstream is for reading from a file. I am trying to write into a file by taking commandline input from the user which is the accept_data() function and and then display all the data from the file that the … |