CPP Functions

Regarding all zip files for download.

  • All downloadable zip files contains a Microsoft Visual CPP solution with code examples.
  • Needed tools for all examples can be found in the right menu on this page.
Create and use a Function Download
How to create function and how to use it. Functions.zip
Using function with prototyping Download
Functions consist of a header, which will be the name and any included parameter to the function, and a body which will be the code inside the function braces. FunctionProto.zip
Function and default parameter values Download
You can setup default values to parameters within the prototyping of the function. You should not do this at the implementation of the function. FunctionDefaults.zip
Functions Overloading Download
In C++ you can create several functions with the same name. We say that these functions overload each other. FunctionOverloading.zip
Function Inline Download
If a function is declared/prototyped with the keyword inline, the compiler does not create a real function it copies the code from the inline function directly into the calling function. FunctionInline.zip
Function that call itself Download
When function can call itself it is called recursion. FunctionCallSelf.zip
Pointers to Functions Download
How to declare a pointer variable that points to a function and to invoke the function by using that pointer. PointerToFunction.zip
Passing a pointer to function to other functions Download
You can pass Pointers to Function as parameter to other Functions PassPointerToFunction.zip
Pointers to Class Methods Download
For a pointer to a method we use the same syntax as with a pointer to function, but include the class name ending with the scoping operator (::). A pointer to a class method can be created inside a class or outside a class. PointerToMethod.zip
Friend Classes and Functions Download
If you want to expose your private member data or member functions to a function defined outside a class, you must declare that function to be a friend inside the class. A friend Function or class method can be defined anywhere inside the class declaration. FriendClassFunction.zip

© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.