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