What should I do to fix this error: "Switch quantity not an integer" with this piece of code?
Code:
if(argc == 2){
switch(argv[letter]){
case 'g':
for(j = 0; j < (width * height); j++){
scanf("%c%c%c", &image[j].r, &image[j].g, &image[j].b);
}
i = greyscale(image);
break;
case 'r':
for(j = 0; j < (width * height) - 1; j++){
scanf("%c%c%c", &image[j].r, &image[j].g, &image[j].b);
}
i = rotation(image);
break;
default:
printf("%c%c%c", image[j].r, image[j].g, image[j].b);
}
}
It's for a programming assignment and I'm supposed to execute the program like this: ./a.out r < ****.ppm(for rotation) or ./a.out g < ****.ppm (for greyscale).