| | |
Code that stores and retrieves.
hi every body try out this code it can store your info and then retriaeve it ant any time you wish.
They are two codes each wrote separatly so first write the outputting code and run it.
Then write the inputting code and also run it
have fun:lol:
They are two codes each wrote separatly so first write the outputting code and run it.
Then write the inputting code and also run it
have fun:lol:
//code for out putting on the file private.dat. #include<iostream.h> #include<fstream.h> #include<stdlib.h> void main() { ofstream my_record("private.dat",ios::out); if(!my_record) { cerr<<"the fail can not be created"<<endl; exit(1); } int age; char name[10]; int registration; while(cin>>age>>name>>registration) { my_record<<age<<' '<<name<<' '<<registration<<endl; cout<<"---"<<endl; } //code for in putting on the file private.dat. #include<iostream.h> #include<fstream.h> #include<stdlib.h> void display(int,const char*const,int); void main() { ifstream my_record("private.dat",ios::in); if(!my_record) { cerr<<"the fail can not be found"<<endl; exit(1); } int age; char name[10]; int registration; cout<<"AGE\t NAME \tREGESTRATION"<<endl; while(my_recod>>age>>name>>registration) diplay(age,name,registration); } void display(int d,const char*const t, int y) { cout<<d<<'\t'<<'\t'<<t<<'\t'<<'t'<<y<<endl; }
Similar Threads
- SQL database stores data twice (ASP.NET)
- How a web browser retrieves a web page? (Domains and DNS)
- Database Design help for stores (Database Design)
- Online Computer stores? (Geeks' Lounge)
| Thread Tools | Search this Thread |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf scripting segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi




