What is semaphore? ,Is C an object-oriented language?

What is semaphore?
Semaphore is a special variable, it has two methods: up and down. Semaphore performs atomic operations, which means ones a semaphore is called it can not be inturrupted.
The internal counter (= #ups – #downs) can never be negative. If you execute the “down” method when the internal counter is zero, it will block [...]

Could you tell something about the Unix System Kernel?

Could you tell something about the Unix System Kernel?
The kernel is the heart of the UNIX openrating system, it’s reponsible for controlling the computer’s resouces and scheduling user jobs so that each one gets its fair share of resources.
What are each of the standard files and what are they normally associated with?

They are the standard [...]

How can you tell what shell you are running on UNIX system?

How can you tell what shell you are running on UNIX system?

You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could [...]

What is a node class? , What is a container class? What are the types of container classes?

What is a node class?

A node class is a class that,
* relies on the base class for services and implementation,
* provides a wider interface to the users than its base class,
* relies primarily on virtual functions in its public interface
* depends on all its direct and indirect base class
* can be understood only in the [...]

What is an adaptor class or Wrapper class?

What is an adaptor class or Wrapper class?
A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non-object-oriented implementation.
What is a Null object?

It is an object of some class whose purpose is to indicate that [...]

What is an incomplete type? What is a dangling pointer?

What is an incomplete type?
Incomplete types refers to pointers in which there is non availability of the implementation of the referenced location or it points to some location whose value is not available for modification.
int *i=0×400 // i points to address 400
*i=0; //set the value of memory location pointed by i.
Incomplete types are otherwise [...]

What is a modifier? , What is an accessor?

What is a modifier?
A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also known as ‘mutators’. Example: The function mod is a modifier in the following code snippet:
class [...]

What is “mutable”? ,Differences of C and C++ Could you write a small program that will compile in C but not in C++ ?

What is “mutable”?
Answer1.
“mutable” is a C++ keyword. When we declare const, none of its data members can change. When we want one of its members to change, we declare it as mutable.
Answer2.
A “mutable” keyword is useful when we want to force a “logical const” data member to have its value modified. A logical const [...]

In C++, what is the difference between method overloading and method overriding?

In C++, what is the difference between method overloading and method overriding?

Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual [...]

Will the following program execute?

Will the following program execute?
void main()
{
void *vptr = (void *) malloc(sizeof(void));
vptr++;
}

Answer1
It will throw an error, as arithmetic operations cannot be performed on void pointers.
Answer2
It will not build as sizeof cannot be applied to void* ( error “Unknown size” )
Answer3
How can it execute if it won’t even compile? It needs to be int main, not void [...]