Categories
Operating System

Semaphore Implementation

Semaphore Implementation The main disadvantage of the mutual-exclusion solutions and of the semaphore definition given here is that they all require busy waiting. While a process is in its critical section, any other process that tries to enter its critical section must loop continuously in the entry code. This continual looping is clearly a problem […]

Categories
C++

Inheritance in c++

Inheritance in c++ Inheritance in c++ is described that Deriving a new from an existing class is known as inheritance. In inheritance, the existing class is known as the base class or parent class, and the new class is known as the derived class or child class.   Inheritance concept is basically used to reuse […]

Categories
C++

Constructor & Destructor in C++

Constructor & Destructor The syntax of constructor and destructor is the same. The constructor name is totally same as the class name and the class name is used for the name of the destructor, with a tilde ~ sign as the prefix to it. What is Constructor? Constructor is a method. Constructor name must be same as […]

Categories
C++

Class and Object in C++

Class:- The major destinations of Class and object in c++ are given below:- The class is used to create the blueprint or architecture. Class is the combination of data member and member function.Class is a user-defined data type, which holds its own data members and member functions or method, which can be accessed and used […]

Categories
C++

Function in C++

FUNCTION in C++ A function in c++ is a group of statement that together performs a particular task. Every C++ program contains a function, that is the main function. Main () is the entry point of the program. At this point, the execution of the program is started. Syntax:- void main() { ———- ———- } What […]

Categories
C++

CONTROL STRUCTURE in C++

CONTROL STRUCTURE in C++:- A control structure is a block of programming that analyzes variables and determines the order in which statements are executed. Loop Control Structure:- For For(initialize counter; test condition; re-evaluation parameter) { Statement; Statement; } While while(test condition) { Body of loop }   Do-while do { statement; } while(condition) Selection Control Structure:- Switch […]

Categories
C++

Operator in C++

Operator in c++ Operators are the foundation of any programming language. C++ programming language is incomplete without the use of operators. Operators are used to performing specific mathematical and logical computations on operands. Operator  in C++ is given below:- C++ provide following types of operator:- Arithmetic operator :-  +   –  *  /  %  ++  — […]

Categories
C

What is Command Line Argument in C

COMMAND LINE ARGUMENT:- Command line argument in C is a mechanism by which a program takes input during runtime. The main function takes two parameters in a command line argument such as Argument Counter:- It counts the number of argument on the command line. Argument Vector:- Is a pointer array which points to each argument […]

Categories
C

File Handling in C

FILE HANDLING IN C:- File & Directory:- File is a mechanism which stores data and Directory is a mechanism which stores file. Types of File:- Regular File Directory FIle FIFO File Socket File Link File Character special File Block special File The maximum size of the file depends upon the file system such as Windows:- […]

Categories
C

Structure and Union in C

Structure and Union:- Structure:- Structure is a mechanism which groups different data member to form a record. A structure is suitable for creating a database memory link and link list and creating bit-field. Basically, structure is used to defines as a record. Syntax:- struct [structure name] { member definition; member definition; … member definition; }; […]

Categories
C++

Datatype in c++

Data type in C++ The Data type in c++ are divided into 4 types:-       primitive:             bool, char, int, float, double, empty:                  void     derived:                array, pointer, reference    user-defined:      enum, typedef, struct, union, and class some basic or primitive data type with an example:- bool:- Boolean can represent true […]

Categories
C

Preprocessor Directives in C

Preprocessor Directives in C:- The c preprocessor is known as CPP is a macro processor that is used automatic call by the compiler to transform your program before compilation. Macro is a symbolic name of expression. Different type of pre-processor directive:- i)macro expansion: #define, #undef ii)File inclusion directive: #include iii)Conditional directive: #if,#else,#endif,#elif, #ifdef, #ifndef iv)Miscellaneous directive: #pragma All […]

Categories
C++

What is OOPS ?

What is OOPS? OOPS stands for Object-oriented programming language. The object Oriented programming language is a programming style that is associated with the concept of Class,  Objects and various concepts like Inheritance, Polymorphism, Abstraction, Encapsulation etc. What are the features of OOPS? The features of oops are: Objects Classes Abstraction Encapsulation Inheritance Overloading Exception Handling […]

Categories
C++

What is the difference between POP and OOP?

Difference between POP and OOP? The difference between pop and oop are given below:- Subject of Difference Procedure Oriented Programming (POP) No. Object-Oriented Programming (OOP) Problem decomposition Decompose the main problem in small parts called functions. 01 Decompose the main problem in small parts called objects. Connections of parts Connect small parts of the program […]

Categories
C++

What is the difference between C and C++

Difference between C and C++  The differences between C and C++ are given below:- C:- 1.C was developed in 1972 2.C was developed by Dennis Ritchie. 3.C is procedural oriented 4.C is compiled language. 5.C is a middle-level language. 6.C support pre-processor. 7. Pointer concept is present in C. 8.C doesn’t support method overloading. 9.C […]