Function in C++

Functions in Cpp C++ C Plus Plus 

   main function:
l  In C++, default return type of main function is int.
l  In C++, if a main function is not prefixed by any return type then it is assumed as int. In such cases if you do not return any int value by using keyword return, a warning occurs during compilation- “Function should return a value”. This situation can be avoided by using return keyword in main or use void before main.
   Function Prototype:
l  The prototype describes the function interface to the compiler by giving details such as the number and type of arguments and type of return values.
 
syntax  :
      return type function name (argument list);
l  Function prototype is also known as function declaration.
l  If a function is declared outside any function that is globally, then function can be called from any part of the program.
l  If a function is declared inside a particular function, then it is called local declaration. This means function can be only called from the function where it is declared.
 
More Details Coming Soon.
     How to use memberfunctions/methods in C++ Cpp C Plus Plus
How to use memberfunctions/methods in C++ Cpp C Plus Plus
How to use memberfunctions/methods in C++ Cpp C Plus Plus
How to use memberfunctions/methods in C++ Cpp C Plus Plus
How to use memberfunctions/methods in C++ Cpp C Plus Plus

No comments:

Post a Comment