Did you even try
googling[
^].
MySQL++[
^] is a C++ binding of the
MySQL C API[
^].
Failing that, you can use
ODBC[
^] and write your own C++ bindings for it.
When I was dealing with databases a while back, I went for the latter option as it is database independent, it will work with any database that has ODBC drivers (MySQL, Microsoft SQL, Firebird, Microsoft Excel, Microsoft Access, ...)
Since this sounds like homework I wont provide you any code. There is already enough of it out on the Internet anyway. Learn to use Google.