B
Brian Dude
Hello, I'm working on some graphics routines and just started trying to
read in some bitmap files. For troubleshooting, I'm printing out various
values to make sure they're all okay.
I have two globals and a local whose values I wanted to verify. I made a
bitmap header structure for obtaining info.
int chunx;
int scan;
int main(int argc,char *argv[])
{
int slwb; /*Scan Line Width in Bytes*/
struct W3_BMP_header Q;
long int X;
FILE *bmpsource;
/*other variables*/
readBMheader(&Q,bmpsource);
scan=(int)Q.height;
X= Q.width%2==0 ? Q.width/2 : Q.width/2+1;
slwb=X+(4-X%4)%4;
chunx=(int)(Q.width/8+(Q.width%8>0));
printf("\nchunx = %d\nslwb = %d\nscan = %d\n",chunx,slwb,scan);
For some reason, the value for 'scan' keeps showing up as 0, only in
this particular printf() call. Both 'chunx' and 'slwb' show up
correctly. I made a separate printf() call displaying only the 'scan'
variable (both before and after the other printf), and it shows up fine.
What's going on?
TIA,
Brian Dude
read in some bitmap files. For troubleshooting, I'm printing out various
values to make sure they're all okay.
I have two globals and a local whose values I wanted to verify. I made a
bitmap header structure for obtaining info.
int chunx;
int scan;
int main(int argc,char *argv[])
{
int slwb; /*Scan Line Width in Bytes*/
struct W3_BMP_header Q;
long int X;
FILE *bmpsource;
/*other variables*/
readBMheader(&Q,bmpsource);
scan=(int)Q.height;
X= Q.width%2==0 ? Q.width/2 : Q.width/2+1;
slwb=X+(4-X%4)%4;
chunx=(int)(Q.width/8+(Q.width%8>0));
printf("\nchunx = %d\nslwb = %d\nscan = %d\n",chunx,slwb,scan);
For some reason, the value for 'scan' keeps showing up as 0, only in
this particular printf() call. Both 'chunx' and 'slwb' show up
correctly. I made a separate printf() call displaying only the 'scan'
variable (both before and after the other printf), and it shows up fine.
What's going on?
TIA,
Brian Dude