Newbie: resizing a bitmap
===

        // determine padding for scanlines
    int padding =  (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;

    // iterate over infile's scanlines
    for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++)
    {
        for(int q = 0; q < n; q++)
        {
            // iterate over pixels in scanline
            for (int j = 0; j < bi.biWidth; j++)
            {
                // temporary storage
                RGBTRIPLE triple;

                // read RGB triple from infile
                fread(&triple, sizeof(RGBTRIPLE), 1, inptr);

                // write RGB triple to outfile
                for (int r = 0; r < n; r++)
                    fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);

            }

        // skip over padding, if any
        fseek(inptr, padding, SEEK_CUR);

        //then add it back (to demonstrate how)
        for (int k = 0; k < padding; k++)
            fputc(0x00, outptr);
       }
    }

I'm trying to alter code so that I can resize a bmp by a factor of n (adding n triples to the the width and the height).  I have found a way to iterate a for loop that will resize the width >  for (int r = 0; r < n; r++)   I tried to do the same thing with height and I can't figure out why it won't work.  >  for(int q = 0; q < n; q++)