We have a test on tuesday, and I was hoping to get some step by step help on implementing functions and identifying their prototypes. I went to the tutorial, but still don't fully understand. Can someone please direct me somewhere with examples on how to implement a function and display it's prototype?
This is the prototype for a function called eatSomeChips that returns a passenger object and accept two input arguments; an int called beans and a catArray called hopelessness.
To implement the function, take the prototype and add the actual code that makes it do whatever it does.
1 2 3 4 5
passenger eatSomeChips (int beans, catArray hopelessness)
{
// Lots of code in here
// return a passenger object.
}
you almost never actually need function prototypes. all they let you do is call a function that you havent defined yet. you can just define all of your functions at the top of your program and often this can be simpler and easier :)