Hi everyone,
I am trying to get the quality of the read from the bam file with the samtools c++ library.

I am using the following (partial) code:
bam1_t *b = bam_init1();
while(samread(reads, b) >=0){

uint8_t *readQual = bam1_qual(b);

for(int k=0;k<readLength;k++){
            cout<<readQual[k]<< " ";

but I am not getting correct values for the read quality.

Does anyone have any suggestion on what I am doing wrong?

Thanks in advance!