Hi everyone, I'm writing a function definition for my header file and I can't get rid of this "declaration is incompatible with" error.
This is my header:
The error appears in the .cpp file at "checkFlush". I found a post with a similar problem, and they concluded that this was because one of their arguments wasn't declared (I'm guessing Card::Suit arr[5] in my case). I'm just wondering where I'm supposed to declare this?
I don't see how they're different...They both have the types Card::Suit and int don't they? I'm sorry if this is a stupid question, I've always been kind of confused with function arguments
No. Your prototype has those types. Your implementation uses different types.
Your prototype takes one Card::Suit object by value. The actual implementation takes a pointer to Card::Suit. The prototype takes an int by value, the actual implementation takes an int by reference.