C++


Totel:235 Click: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

c++ Interview Questions And Answers

Page 1

 Question :

what is the difference between parameter and argument?


Diff b/w parameter and argument is :
Argument bassically is one of the following -
> An Expression in the comma-separated list in a function call.
> A sequence of one or more preprocessor tokens in the comma-separated list in a macro call.
> Its represent the value which you pass to a procedure parameter when you call the procedure. The calling code supplies the arguments when it calls the procedure.
> It is something passed into a function(value), whereas a parameter is the type of data plus the name.
Parameter bassically is one of the following -
> An object that is declared in a function declaration or definition.
> An identifier b/w the parentheses immediately following the macro name in a macro definition.
> It is represent a value that the procedure expects you to pass when you call it. The procedure's declaration defines its parameters. 
       This example explains the difference b/w a parameter and an argument:

void function(int x, char * rs); //x and rs are parameters
template <class Tem> class M {}; //Tem is a  parameter

int main()
{
  char c;
  char *p = &c;
  func(5, p); //5 and p are arguments
  M<long> a; //'long' is an argument
  M<char> another_a; //'char' is an argument
  return 0;
}

 
What is the difference between class and structure?

Diff b/w Class and Structure is : 
Class is difined as-
>Class is a successor of Structure. By default all the members inside the class are private.
>Class is the advanced and the secured form of structure.
>Classes are refernce typed.
>Class can be inherited.
>In Class we can initilase the variable during the declaration.
>Class can not be declared without a tag at the first time.
>Class support polymorphism.
Structure difine as :
> In C++ extended the structure to contain functions also. All declarations inside a structure are by default public.
> Structures contains only data while class bind both data and member functions.
> Structure dosen't support the polymorphism, inheritance and initilization.
> Structure is a collection of the different data type.
> Structure is ovrloaded.
> Structures are value type.
> Structure can be declared without a tag at the first time

 What is the difference between an object and a class? 

Class and Objects are diff but related concepts. Every objects belogs to the class and evry class have a one or more related objets.

Class are:
> A Class is static.
> A class combination of data(called data members)and functions(called member functions).
> Class is a userdefined datatype with data members and member functions.
> Classe defines object.
> One class can define any no of Object.
> Class is a template(type) or blue print its state how objects should be and behave.
Object are:
> Object is an instance of a class while a class can have many objects.
> Object is a dynamic.
> Objects are the basic runtime entities in an object oriented sysyem.
> Data and function which combine into a single entity is called object.
> Objects are instances of classes which identifies the class propeties.
> Object can't define classes.
> Object can created and destroyed as your necessity.
> Object is defined as a s/w construct which binds data and logic or methods(functions) both.

 Difference between realloc() and free()?  

Diff b/w realloc() and free():
realloc():
> It is used to free the memory in the program.
> This function is used to resize memory.
> realloc() means it giving string variables into the existed memory
free():
> Basically It is a macro. Macro used to deallocate memory.
> free() function is used free the memory which is allocated by malloc(),calloc() functions. 
> free() means it empties the array.

 What is a template?  

Templates is defined as :
> It is a framework for web pages and sites.
> Its type of model or standard for making comparisons.
> It is a feature of the C++ programming language its allow functions and classes to be operate with generic types.
> It is a tool for enforcing a standard layout and look and feel across multiple pages or within content regions.
> Its a model or pattern used for making multiple copies of a single object.


Goto Page:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

c++ Objective Questions And Answers

c++ Objective Questions And Answers

c++ Interview Questions And Answers

c++ Interview Questions And Answers


R4R,c++ Objective fresher and experienced, c++ Subjective fresher and experienced ,c++ Interview Questions And Answers,c++ fresher and experienced,c++ Interview fresher and experienced ,c++ Questions fresher and experienced,c++ Answers fresher and experienced

This section covers c++ interview questions and answers for fresher and experienced . In this section we covers c++ interview questions for experienced ,c++ interview questions for freshers .

This section covers c++ Objective interview questions and answers for fresher and experienced. In this section we covers c++ Objective interview questions for experienced ,c++ Objective interview questions for freshers

This section covers c++ Subjective interview questions and answers for fresher and experienced. In this section we covers c++ Subjective interview questions for experienced ,c++ Subjective interview questions for freshers