Hi guys, quick question. How can I prototype this function? Usually for a function using the basic data types, I just do this:
void insertData(int);
The function below needs to get a data structure, and I really don't know how to prototype it as it's the first time I'd be prototyping a function that needs a data structure. A little help?
void displayData(struct Node *);
As you can see a prototype is generally the same as the first line of a definition, except you can omit parameters names and it needs a semicolon at the end.
The reason why it worked was because it matched the function definition itself, with name of the parameter omitted, though that is optional. Sometimes it is better to keep the parameter names in the prototype, as the use of meaningful names helps the reader to understand the purpose of each parameter and how it is intended to be used.
Usually I write the function first, then copy & paste the first line to give the prototype.