this seems weird to me... their seems to be something wrong with the while loop conditions.. the way it is written now i wouldnt have though that the loop would even start because vname+viso+vaperture=0
heres my code
also i get a segmentation error when i try to input the iso in the else if partCode:int main(int argc, char * argv[]) { // Mainline Variable Declarations FILE * output = stdout; FILE * input = stdin; int vname=0, viso=0, vaperture=0, error=0, quit=0, iso; char selection[2], name[20], aperture[2]; while ((strcmp(selection,"Q")!=0) || (vname + viso + vaperture != 0)) { fprintf(output,"\n1. First name\n2. ISO setting\n3. Aperture setting\n\nPlease enter a menu number or '?' for help\n" ); fscanf(input,"%s[2]",selection); if (strcmp(selection,"1")==0) { fprintf(output,"\nPlease enter your first name\n"); fscanf(input,"%s[20]",name); error=1; vname=1; } else if (strcmp(selection,"2")==0) { fprintf(output,"\nAcceptable ISO settings include:\n\n6, 8, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100," " 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000 and 6400.\n\n" "Please enter your ISO setting\n"); fscanf(input,"%d",iso); } } }



LinkBack URL
About LinkBacks


