Hello coders!! Plz is there a way to link C++ to a database to store some informations? | SoloLearn: Learn to code for FREE!

0

Hello coders!! Plz is there a way to link C++ to a database to store some informations?

6/2/2020 10:10:54 AM

YoungMind

2 Answers

New Answer

+2

I would not recommend the use of the header fstream.h to link C++ code to databases. The fstream classes are for basic file handling. A database is usually managed by a database management system. Attempting to directly manipulate database files or tables in C++ can damage, or even destroy, the data integrity of the database. The safest way to interact with databases from C++ is to use either the Open Database Connectivity (ODBC) application programming interface (API), or some other API or library provided by the database vendor. If on the other hand you just want to write some stuff to a file for your own application then by all means use your own file structure and fstream, or cstdio, for file io.

0

Use header file fstream.h