These are both warnings; in this case the code referred to by the warnings is correct but it could have its style improved. You should be able to run the program even though it showed warnings; since there were no errors. (BTW you should have help files that came with the compiler; these will tell you what the warnings mean if you find the warning text unclear).
The first warning is because you have:
int i = 0;
for (i = 0;
i.e. the first setting of = 0
is redundant because you immediately set it to 0
again.
The second warning is because you did not provide a prototype for money
. You should declare the function as:
float money(void)
This makes it be a prototype, which has the effect that the compiler will flag an error if you later try to pass an argument to the function.
However, your code has other bugs which the compiler did not diagnose (or if it did, you didn't let us know).
Firstly you use j
without initializing it. You should give it a value before using it.
Secondly, scanf("%d*%c", &wages[i]);
is wrong. The format specifier for float
is "%f"
, not "%d*%c"
. Also , i
is out of range at this point (did you mean to have this code inside the loop?)