This is for Auto Dealership to keep track of what cars they have in stock, not for user purchase.The user is AUTO DEALERSHIP!!
Printable View
I see. In that case, absolutely nothing about my suggestion changes. An auto dealership purchases cars from automobile factories. That's all what you're concerned about really means.
Hi guys, Since my last visit here,I have made few changes in the code,implemented a tree to give users choice,seperated some codes into method and then into different files.I am now running the main program from main method file.The program works well but isn't fully functional.I was looking to display the content of my inventory into a text file from which I plan to use a sorting file to sort the contents.The thing is the method works well but only for one line and console crashes if I try to rerun the method.Also,I don't know how should I sort the contents from text file(What data structure?)
Edit(After rewriting code into write_text method)
The functions starting with f doesn't work in display method for saving linked list contents to file.Code:void write_text(){
struct node *ptr=start;
int j;
FILE *ptr_file;
ptr_file =fopen("output.txt", "w");
while(ptr != NULL){
fprintf(ptr_file,"\n%d.\t%s %s %d %s \n", j,ptr->data.carname,ptr->data.carmodel,ptr->data.caryear,ptr->data.cartype);
ptr = ptr->next;
j++;
}
fclose(ptr_file);
}
Can you please help me with this??