Like Tree1Likes
  • 1 Post By Matticus

C++ Database? Help plz

This is a discussion on C++ Database? Help plz within the C++ Programming forums, part of the General Programming Boards category; Hi, How is it possible to store the related data of a program C++ into an external file (like as ...

  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
    2,570
    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
    shansajid likes this.

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, 09: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21