Wednesday, 31 December 2014

Process and Process management in UNIX

Process and Process management:  Some library functions works for OS and some other works for specific purpose.  API---Application Programming Interface(taking help of library)  SCI--- System call interface  .dll file of one OS can’t be accessible by another OS.  fread--- is a function used to read binary data and store in memory based on requirement.  Syntax: int fread(int,void *,int); Manual page: ...
Read More

Tuesday, 30 December 2014

Copy Constructor in C++ to reduce code complexity

Copy constructor:   Extract the source into destination element by element.  Here the size of class name has been passed.  Here both objects have different sizes.  Here one element will be taken as source and put it onto destination.  Like this entire object data is copied into destination. Hence it called “copy constructor’. class Vector { int size; int *v; Vector(int s) { size=s; v=new int[s]; } void get() { for(int i=0;i>v[i]; } }; Vector(Vector pv) { size=pv.size; //sizeof(v1) v=new int[size]; for(int...
Read More

Dynamic memory allocation in C++

Dynamic memory allocation in C++:   “New” is an operator in c++. Which is used to allocate the memory dynamically. In C, dynamically memory allocation: Int *p; P=malloc(n*sizeof(int)); Here malloc is a library function. If malloc is success, void pointer is returned. If malloc fails then NULL pointer is returned. If (n*sizeof(int)) is success, then only type casting allowed.  In C++, dynamic memory allocation: Int *p=new int[5]; Data_type *pv; pv=new Data_type[size]; Here we are using integer array. Hence return type...
Read More
Functions of network devices Separating (connecting) networks or expanding an existing network.  Examples: repeaters, hubs, bridges, routers, switches, gateways  are used to provide communication between network devices. Network devices used for Remote access Example: Remote access devices are 56K Modems and ADSL modems we should follow the following steps while Expanding Network Networks cannot be made larger by simply adding new...
Read More

Monday, 29 December 2014

Overview of UNIX system

who invented UNIX system? UNIX system was first described in 1974 by ken Thompson and Dennis Ritchie. Thompson and Ritchie implemented the UNIX On PDP-7 computer and later on PDP-11 ( 1971 ) In 1973 the UNIX was written in C programming language. Architecture of UNIX System What are inputs and outputs of UNIX system? Each and Every file has its own file descriptor. file descriptor contains the information related to weather...
Read More

Wednesday, 17 December 2014

Important feature of C++: Encapsulation

Encapsulation: Binding the details(int,char,float,string) together in a class is called encapsulation.   Class is also like a structure. Compared to structures, C++ class has the following extra features Features of class in C++: 1) Protect 2) Private 3)Public Above declared variables can be visible to everywhere in our program.  Because, we have mentioned that the class variables are public. Creating...
Read More

Tuesday, 16 December 2014

inline to reduce transitions between function calls

inline is a keyword to execute a particular function repeatedly in inline fashion. This concept comes into role to reduce the code size. Actually code size not reduced. Number of lines of program can be reduced. Requesting the compiler to replace the function body in the calling function place is called inline. Benefits of inline keyword:  1) Number of transitions between calling function and called function can be reduced. 2) Same stack...
Read More

Function overloading Concept with lot of examples

The following rules are applicable for implementing function overloading concept. 1)      Function name should not be a keyword. Meaningful name should be given to function names and variables. 1)      C++ allows more than one function with the same name with signature. This concept is called “function overloading”. Signature means either the number of parameters or data types of parameters...
Read More