<p>I am looking for a library to parse a GTF file in C++. I&#39;m using htslib for SAM/BAM, and it works well. However, I am not aware of any library that can handle GTF format for me. Is there a good library that I can use to parse GTF file, or should implement a parser myself?</p>

I have C code for parsing GTF in *convert2bed* on my Github page: https://github.com/alexpreynolds/convert2bed

The <a href="https://github.com/alexpreynolds/convert2bed/blob/master/convert2bed.c#L872-L1048">relevant function</a> parses an input buffer into a <a href="https://github.com/alexpreynolds/convert2bed/blob/master/convert2bed.h#L260-L291">`c2b_gtf_t` struct</a>. You could leave out the last line of the conversion function, if you do not need BED output.