char* fieldName(int fieldno);
The function fieldName() returns a name of a field by index.
If the index is out of range then the function returns NULL.
{
// your code
for (int i=0; i < dbf->fieldCount(); i++)
printf( "%s\n", dbf->fieldName( i ) );
// your code
}