answersLogoWhite

0

How to create a function?

User Avatar

Anonymous

15y ago
Updated: 8/17/2019

You create a function by declaring it and defining it. A trivial example... int myfunction (int myargument) { /* declaration */

... some code, ultimately returning an int /* definition */

} You could also declare separately from the definition, a technique often used in header files... int myfunction (int myargument); /* declaration - note the semi-colon */ ... later ... int myfunction (int myargument) { /* definition */

... some code, ultimately returning an int

}

User Avatar

Wiki User

15y ago

What else can I help you with?