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).
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)
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 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
Constructors & Destructors in C++ (OOPs)
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)
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)
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.
January 23, 2013
Union in C-language
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
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
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
Prototype Function
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
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
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 in 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.
Subscribe to:
Posts (Atom)