Tell me about writing functions. What are the three steps, and what do they mean? Where do they go? What do they look like?
The 3 steps for a function is definition, call, and declaration. The declaration goes above main, the call goes inside main, and the definition goes after the end of main. The declaration would look like this: return type name(parameters); The definition is going to look similar, just instead of the semi colon it is going to have curly brackets. The call is going to have more things taken away, for example: name(parameters);.
No comments:
Post a Comment