that error came up in my gnu compiler.... repeatedly.
Here's the code:
Now, what the hell am I doing wrong? I'm sure it has something to do with my pointer poerator... or something...Code:#include <stdio.h> void first_prn(); float charge_counter(int *); int main(void) { int a=725, b=115, c=600, d=327, e=915, f=1011, g=47, *q; int i=1; int total; int charge; *q = &a; first_prn(); printf(" 123 725 $ %f \n", ++i, charge_counter(q)); *q = &b; total = charge; printf(" 205 115 $ %f \n", ++i, charge_counter(q)); *q = &c; total=total+charge; printf(" 464 600 $ %f \n", ++i, charge_counter(q)); *q = &d; total=total+charge; printf(" 596 327 $ %f \n", ++i, charge_counter(q)); *q = &e; total=total+charge; printf(" 601 915 $ %f \n", ++i, charge_counter(q)); *q = &f; total=total+charge; printf(" 613 1011 $ %f \n", ++i, charge_counter(q)); *q = &g; total=total+charge; printf(" 722 47 $ %f \n", ++i, charge_counter(q)); total=total+charge; printf("Total: %d 3740 $ %d \n", i, total); return 0; } float charge_counter(int *q) {float charge; int y; y = *q; if (y <= 300) {charge = .09 * y;} else if (y > 300 && y <= 600) { (charge = 27 + (y - 300) * .08);} else { if (y > 600 && y <= 1000) { (charge = 51 + (y - 600) * .06);} else {(charge = 75 + (y - 1000) * .05);} } return charge;



LinkBack URL
About LinkBacks


