I'm trying to take an input integer between 1 and 100 and store its value as n, which I will then refer to as the scale factor, and use it later on in the redefinition of bi.biWidth *= n; and in similar ways to resize the image by the scale factor, and have written code that will give an error message if it's not an integer between 1 and 100, but my code seems to be giving an error even when a correct input is given. I've tried debug50, and for some reason it suggests that n is 0, even when I input an integer, and then it switches to some garbage (eg -6235) value when you start the if statement. My code is:
int n = (int) &argv[1];
// ensure integer is input as scaleFactor
if (n > 100 || n < 0)
{
printf("Usage: scaleFactor infile outfile\n");
return 91;
}
What do you think? I seem to be getting stuck and asking for help every pset...this is worrying. Thank you!