-
C++ Database? Help plz
Hi,
How is it possible to store the related data of a program C++ into an external file (like as .txt) and retrieve it?
I want to write c++ program that can contain data members " id and phone"
like as
Code:
class profile
{
private: int id,phone;
public:
void retriever()
{
cout<<"Enter your ID: ";
cin>>id;
cout<<"Your Phone number is "<< phone;
};
}
avoiding formats in above class, purpose is to store data already in txt file with different id and phone numbers and it is to be retrieved by matching id number to txt file and viewing its related phone number.
How it is possible?
-
There are many tutorials online for file I/O. One is here ("C++ Tutorial" link at the top of the page): C++ File I/O Tutorial - Cprogramming.com