0

I am trying to make a system that stores user account details in C. I know the storing of data could be done by writing all the data into files but I was wondering if their is any other way to store information like maybe a connection with some database application like MySQL etc. I don't know if that's possible.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • No, using only *standard C* it's not possible. The standard doesn't include any kind of database API. You need to use external libraries, and each database usually have it's own library and API that you can use. Read the documentation for the database you want to use. – Some programmer dude Aug 27 '15 at 05:18
  • You can look into SQLite. – user12205 Aug 27 '15 at 05:18
  • Lots of ways. ODBC drivers can be used to connect to many different DBMS, including MySQL. There are usually alternative ('native') methods for connecting too. You could consider SQLite3, too. But none of these methods is standardized as part of 'ANSI C'. – Jonathan Leffler Aug 27 '15 at 05:19
  • I have experience in using SQLite with ANSI C. SQLite have libraries for C. This link may help you to interface SQLite with C: http://www.tutorialspoint.com/sqlite/sqlite_c_cpp.htm – K.H.A.J.A.S Aug 27 '15 at 05:20

1 Answers1

2

SQLite is embedded database which means you just include its source code into your project and it's written in C. So you just add header and call functions directly from your code. It has a pretty good manual. Yet, database storage might be too complicated if you have small amount of data.

EvgeniyZh
  • 898
  • 9
  • 21