-1

here in my program i must ask the user for his total sales for the month, then ask the user for the county tax rate(6%) and the state sales tax(6%) then calculate the total sales tax based of what they entered. i also must utilize pointers.

i keep getting the following error:[Error] called object 'calculateTaxes' is not a function or function pointer

i cant seem to figure it out. here is the code i have so far

#include <stdio.h>

int inputTaxData(int* totalSales);
float calculateTaxes;
int main()


{
int* totalSales;
inputTaxData(&totalSales);
calculateTaxes();
float c;
float s;
float t;

    return 0;
}


int inputTaxData(int* totalSales)
{
printf("What is your total sales for the month?");
scanf("%d", totalSales);
}


float calculateTaxes(float c, float s, float t)
{
float c = 1.06;
float s = 1.06;
float t = c + s;
printf ("Your total state and county sales tax is %f", totalSales);
}

1 Answers1

0

You declare float calculateTaxes;, i.e. as a float variable.
Then you try to call it as a function.

calculateTaxes();

That is what the compiler tries to tell you.
You probably wanted to instead provide a prototype for the later defined function.

float calculateTaxes(float c, float s, float t);
Yunnosch
  • 26,130
  • 9
  • 42
  • 54
  • There are other issue with your code, which might cause it to fail doing what you expect. I trust however that you will find them yourself, or make corresponding separate questions. – Yunnosch Nov 03 '19 at 07:55
  • i am aware i am missing some separate questions and will get those on there ASAP – MetroProdigy Nov 03 '19 at 08:10