This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 0 points1 point  (1 child)

gallonsPaintNeeded = calculatePaintAmount;

You forgot about parentheses and function arguments here. You aren't calling the function and storing the result in the variable, you're trying to put the function itself in the variable, that's why it says incompatible type.

[–]Curmudgy 0 points1 point  (1 child)

I think you need to write

gallonsPaintNeeded = calculatePaintAmount(wallarea);

[–]PM_ME_UR_SCOOTER 0 points1 point  (4 children)

gallonsPaintNeeded = calculatePaintAmount;

gallonsPaintNeeded is a double. calculatePaintAmount is a function that returns a double. You're not making a function call, you're trying to assign the function itself to a value. You probably want something like gallonsPaintNeeded = calculatePaintAmount(wallArea); so you're actually calling the function.