Cd TOC check in C++

Does anyone know of a way to check the CD table of contents for it’s length in a C++ program?