Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

January 31, 2013

I/O File Handling in C++ (OOPs)


Input output file handling in C++ (OOPs) banner

A File is a bunch of bytes stored on some storage device like magnetic disk or tape etc. Most of the application programs process large volume of data which is permanently stored in files. We can write programs that can read data from file(s) and write data to file(s). 

Polymorphism in C++ (OOPs)


polymorphism sequence and types with description in C++ (OOPs)

Polymorphism is made from two words POLY+MORPHISM which means more the one form. In C++ polymorphism is implemented by overloading a function or an operator. In Function Overloading a single function name is used to perform different tasks. 

January 30, 2013

Inheritance in C++ (OOPs)


Inheritance (reusability) of codes in C++ (OOPs) programming language

It is the process by which objects of one class acquire the properties of objects of another class. The old class is referred as Base CLASS and the class that inherits the Base Class if Derived CLASS

Constructors & Destructors in C++ (OOPs)


constructors and destructors in C++ (OOPs) programming language

In C++, a class only creates a data type and the objects of a class are created and initialized as separate. A constructor (having the same name as that of a CLASS) is a member function which is automatically used to initialize the objects of the CLASS type with legal initial values.

Friend Function in C++ (OOPs)


friend function and class in C++ (OOPs) programming language


A Friend Function is a non-member function that can access private data’s. A friend CLASS is a class whose member functions can access another class i.e. private and protected classes. 

Manipulators in C++ (OOPs)

manipulators in C++ (OOPs)


Some standard manipulators are used in C++ (OOPs) which are stored under header file iomanip.h. Under this it has capabilities to show inter-conversions like binary, decimal, hex-decimal, set the precision for more accurate answer and various other functions like you can see in the programs.

Strings in C++ (OOPs)


various strings operation that are stored under header string.h

January 23, 2013

Union in C-language


practical example of union in day to day life in programming

Union is that data structure which is also user defined data type but to define a union keyword union  is used instead of struct.

Structure in C-language


implementation of structures in programming from day to day life

Structure is the user defined data type which can store heterogeneous data i.e. data of different types. It means in structure member with all possible data type can be used and there is no restriction that elements of the structure are stored at adjacent memory locations. Structure is declared with key word struct followed by its name and then by block. 

Pointers in C-language


syntax and working of showing how pointers points to its particular value

Pointer is that variable which stores the memory address of another variable. It means pointer is itself a variable which stores hex-decimal address of the location.

January 22, 2013

Library String Function



string library functions banner in C language

Call by Value and Reference


call by value and call by reference function banner

Recursive Function


recursion abstract of desktop

This function is that function which calls itself again and again until some base criteria is fulfilled. It means it is that prototype function in which its name appears as a statement at least once. 

Prototype Function

syntax of prototype function in C language


When a function is defined after the main function it needs to be declared in the declaration section of the program. This declaration section statement is known as function prototype.
This tells the calling function the type of value that will be returned with the name of the function and list of argument data types.

Syntax:
return type  function name(Argument list);
int fun (f1,f2);

Function with parameter with return


syntax of function with parameters and return value

This function can also return a value from the called function to the calling function i.e. the output which is printed in the main function whenever the value will be returned to the main function it can be printed thereafter. Now the function type should not be void because function will return a value. Therefore, it’s overall type is decided by the type of value it returned (int, float etc.).

Function with parameters with no return


syntax of function with argument with no return type in C language

Function can also use parameters and these parameters should be specified as a list along with function name with specific data types and each argument should be separated by ‘,’.
In function with parameter or arguments two types of arguments are used ACTUAL PARAMETERS and FORMAL OR DUMMY PARAMETERS.

Function without parameters in C-language


function defining syntax banner without parameters in C language

Such functions are defined same with return type followed by used defined name and a pair of parenthesis () and a block of codes. These functions uses two type of variables AUTOMATIC STORAGE CLASS VARIABLES and GLOBAL VARIABLES.

Function in C-language



function syntax of defining it header in C and C++ language


A function is block of codes that performs a particular task, this block is given a name and whenever we want to execute this block we simply write the name of the function. Function is a small sub-program which is a self contained block of statements and the function which is defined by the user is User Defined Functions.