Multiple levels function

  • c_cpp
  • 閲覧50
/*The following example shows functions at multiple levels - one being called by another:*/
#include<stdio.h>
main ()
{
	/* print a message */
	printf ("Welcome to C.");
	disp_msg ();
	printf ("for good learning");
}
disp_msg ()
{
	/* print another message */
...

///*** 無料ユーザー登録後、正常なすべてのコードが表示されます ***///

					

c_cpp Multiple levels function

コードの説明
The output of the preceding program is:
Welcome to C. All the best for good learning.
In the preceding program:
main(): Is the first function to be executed.
disp_msg(): Is a programmer-defined function that can be independently called by any other function.
(): Are used for passing values to functions, depending on whether the receiving function is expecting any parameter.
Semicolon (;): Is used to terminate executable lines.