Q1 . what are the preprocessors directives in C++?
SOLUTION
These are statements that are executed before the actual program is and all the preprocrocessor directives are preceded by a #.
some examples of preprocessor directives are #define-it is used to define some variables like #define a 10
#include-it is
Q2 . what are signals in C++?
SOLUTION
Signals are like messages that are given out.some examples of signals in C++ are
SIGILL-illegal instruction
SIGTERM-a termination request for the program
Q3 . what is the diffrernce between C and C++?
SOLUTION
C++ is object oriented and C is not.
C++ has poymorphism so it can implement overloading of functions and operators whereas C cannot
C++ has exception handling using try and catch where as C does not.
Q4 . what is the differnce between Java and C++?
SOLUTION
Java is platform independent and C++ is not.
Java uses threads where as C++ does not.
Java does not support operator overloading where as C++ does.
Q5 . what are the basic IO functions in C++?
SOLUTION
The basic function to take data as input is cin and cout is used to display the data.
Q6 . what are constructors?
SOLUTION
Constructors are member functions that have the same name as the class.If we do not create the constructor expcitly the compiler creates it.we can also pass arguments for intialisation of variables.
example class abc{abs(){//this is the constructor}}
Q7 . what are destructors?
SOLUTION
Destructors are member functions that are used to deallocate the resources of a class.to name the destructor it is preceded by a ~ before.class abc{~abs(){//this is the destructor}}.
Q8 . what is polymorhism give an example?
SOLUTION
Polymorphism is when a single function can have different forms based on various parameters like the arguments being passed to the funtion.
let the funtions be
void add()
void add(int a,int b)
now add() will invoke the first funtion and where as add
Q9 . what is constructor overloading?
SOLUTION
In constructor overloading different constructor can be invoked by passing differnet parameters while creating the object.
example
class volume{
volume(){}
volume(int a){}}
now to invoke it from the main functio
volume v1,v2(5);
This way both con
Q10 . what is function overriding?
SOLUTION
Overriding is changing the definition of the function intialised in the base class.