25 day Create a Function To create (often referred to as declare) your own function, specify the name of the function, followed by parentheses () and curly brackets {}: Syntax void myFunction() { // code to be executed }
37 day
Popular posts from this blog
26 day Call a Function Declared functions are not executed immediately. They are "saved for later use", and will be executed when they are called. To call a function, write the function's name followed by two parentheses () and a semicolon ; In the following example, myFunction() is used to print a text (the action), when it is called: Example Inside main, call myFunction(): // Create a function void myFunction() { printf("I just got executed!"); } int main() { myFunction(); // call the function return 0; }
42 day C Structures The structure in C is a user-defined data type that can be used to group items of possibly different types into a single type. The struct keyword is used to define the structure in the C programming language. The items in the structure are called its member and they can be of any valid data type. Additionally, the values of a structure are stored in contiguous memory locations. Syntax struct structure_name { data_type member_name1; data_type member_name1; .... .... };
Comments
Post a Comment