Thread: database

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    1

    database

    Can the file we create for example in notepad be access using C++ programming. Can we see the content of that file? I know that there is a function open() to open up file. But I notice that we can write to the file in the program and read back from the file. But can we write a file in notepad and read it from the program?

    One last question, how can we use or pass the data inside the database to function to process it?

    Urgent!!!

    Thanks.

  2. #2
    Registered User ventolin's Avatar
    Join Date
    Jan 2004
    Posts
    92
    your question seems a little vague and im not 100% sure what you are asking about.

    yes you can access *.txt files using the file i/o in c and c++, read this data into a data structure and then you can access this data to use within function calls, output etc.

    is this what you mean?

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    127
    >But can we write a file in notepad and read it from the program?
    Yes, of course. It would be inconvenient indeed if C++'s file I/O only worked on file that was originally written by a C++ program.

    >how can we use or pass the data inside the database to function to process it?
    What database? Is this database the text file you were asking about previously? If so then a simple vector of strings should have no problem holding the contents of the database in memory. Then you can pass the vector around at will.
    When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. literature database: help with planning
    By officedog in forum C++ Programming
    Replies: 1
    Last Post: 01-23-2009, 12:34 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  3. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  4. Developing database management software
    By jdm in forum C++ Programming
    Replies: 4
    Last Post: 06-15-2004, 04:06 PM
  5. Making a Simple Database System
    By Speedy5 in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2003, 10:17 PM