Thread: C++ Database? Help plz

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    54

    Post 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?

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Database
    By Rustik_ in forum C++ Programming
    Replies: 3
    Last Post: 08-31-2009, 05:48 AM
  2. Database
    By siavoshkc in forum C# Programming
    Replies: 4
    Last Post: 08-03-2008, 03:54 AM
  3. Database to Database Transfer?
    By draggy in forum C++ Programming
    Replies: 4
    Last Post: 01-17-2007, 10:50 AM
  4. MS Database...
    By MipZhaP in forum Windows Programming
    Replies: 2
    Last Post: 09-19-2004, 06:09 AM
  5. Replies: 1
    Last Post: 10-09-2001, 10:20 PM