Skip to main content

Posts

Showing posts from December, 2014

Functions in C++

A function groups a number of program statements into a unit and gives it a name. This unit can then be invoked from other parts of the program. C++ has added many new features to functions to make them more reliable and flexible. C++ function can be overloaded to make it perform different tasks depending on the argument passed to it. Standard C and C++ use a feature called function prototyping . With function prototyping, you must use a description of the types of arguments when declaring and defining a function. This description is the “prototype.” When the function is called, the compiler uses the prototype to ensure that the proper arguments are passed in and that the return value is treated correctly. If the programmer makes a mistake when calling the function, the compiler catches the mistake. In a function prototype, the argument list contains the types of arguments that must be passed to the function and (optionally for the declaration) identifiers for the arguments.

Benefits of OOP [Object Oriented Programming]

The main advantages are: It is easy to model a real system as real objects are represented by programming objects in OOP. The objects are processed by their member data and functions. It is easy to analyze the user requirements. With the help of inheritance, we can reuse the existing class to derive a new class such that the redundant code is eliminated and the use of existing class is extended. This saves time and cost of program. In OOP, data can be made private to a class such that only member functions of the class can access the data. This principle of data hiding helps the programmer to build a secure program that can not be invaded by code in other part of the program. With the help of polymorphism, the same function or same operator can be used for different purposes. This helps to manage software complexity easily. Large problems can be reduced to smaller and more manageable problems. It is easy to partition the work in a project based on object

Protection [Operating System]

Protection is the mechanisms & policies to keep programs & users from accessing or changing stuff they not do. It is internal to OS. Protection refers to a mechanism for controlling the access of programs, processes or users to the resources defined by a computer system. Protection ensures that only processes that have gained proper authorization from OS can operate on the files, memory segments, CPU & other resources of a system. Goals of Protection The OS consists of a collection of objects (hardware or software). Each object has a unique name & can be accessed through a well defined set of operations. The goal is to ensure that each object is accessed correctly & only by those processes that are allowed to do so. The guiding principles of Protection are as follow: 1. Principle of least privilege Programs, users & systems should be given just enough privileges to perform their task so that they can’t alter or harm. 2. Separate “Policy” from “Mechanism”

What is UNIX and Linux?

1,  History of UNIX => UNIX is an Operating System (OS). => UNIX was developed about 40 years ago i.e., 1969 at AT&T Bell Labs by Ken Thompson and Dennis Ritche. => It is a Command Line Interpreter. v It was developed for the Mini-Computers as a time sharing system. => UNIX was the predecessor of LINUX.   2. History of  LINUX => LINUX was created by Linus Torvalds in 1991. => LINUX is a open source. => LINUX is a variant of UNIX. 3.   Why LINUX/UNIX? => LINUX is free. => Can view and edit the source code of OS v It is fully customizable. => Most Important Feature is Stability => 30Years to get the bugs => Important in shared environments and critical applications => LINUX has better security structure. => High Portability. =>Easy to port new H/W Platform. =>Written in C which is highly portable Source: LINUX TUTORIAL