struct data type error

Mar 5, 2016 at 2:12am
fixed
Last edited on Mar 5, 2016 at 3:13am
Mar 5, 2016 at 2:28am
closed account (2UD8vCM9)
The problem is with
string x = restriction(city);

Your restriction function takes the data type: int as the arg and you are trying to pass data type: RainCity to it. I'm not sure what the restriction function is supposed to do or else i'd try to help you out more, but that is what is happening.
Mar 5, 2016 at 2:58am
Your program should call a function that will determine whether there are restrictions on water use and save it in the restriction element of city. The function will return the character ‘y’ if there was less than 4 inches of rain, and ‘n’ otherwise.

if this clear things up.

Yeah i get what your trying to say. I was thinking that too but idk how to change it to make it work.
Last edited on Mar 5, 2016 at 2:58am
Mar 5, 2016 at 2:59am
closed account (2UD8vCM9)
Instead of doing string x = restriction(city); try string x = restriction(city.rainfall);
Mar 5, 2016 at 3:10am
Omg it runs but still theres a problem with the code. I will try my best to fix the rest. Thanks so much. Life saver!


Update: FIXED all good. Kudos to you pindrought thanks for helping
Last edited on Mar 5, 2016 at 3:12am
Topic archived. No new replies allowed.