Recent Interview Questions
- 0of 0 votes
AnswersWhat is conio.h in C++?
- hr@izetam.com February 02, 2022 in United States
Conio.h is a header file used for console input and output operations and is used for creating text based user interfaces.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersHow to set decimal places in C++ ?
- hr@izetam.com February 02, 2022 in United States
For limiting the decimal places in C++ there are five functions : floor(), ceil(), trunc(), round() and setprecision(). Out of these five, only setprecision() function is used for setting the decimal places to put as output| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is type casting in C++?
- hr@izetam.com February 02, 2022 in United States
Type casting in C is used to change the data type. They are of two types: Implicit Type Conversion: It is automatic. Explicit Type Conversion: It is user-defined.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersHow to paste in turbo C++?
- hr@izetam.com February 02, 2022 in United States
Paste in turbo C++ can be done by two techniques:
1. Shift+Insert
2. Open the file in notepad with .cpp extension. Make the changes and save it. After saving the file, you can open it from the Turbo C++ application file menu from where you stored the cpp file.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is a class template?
- hr@izetam.com February 02, 2022 in United States
A class template is used to create a family of classes and functions. For example, we can create a template of an array class which will enable us to create an array of various types such as int, float, char, etc. Similarly, we can create a template for a function, suppose we have a function add(), then we can create multiple versions of add().| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is function overriding?
- hr@izetam.com February 02, 2022 in United States
If you inherit a class into a derived class and provide a definition for one of the base class's function again inside the derived class, then this function is called overridden function, and this mechanism is known as function overriding.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is a destructor?
- hr@izetam.com February 02, 2022 in United States
A Destructor is used to delete any extra resources allocated by the object. A destructor function is called automatically once the object goes out of the scope.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat s Polymorphism?
- hr@izetam.com February 02, 2022 in United States
Polymorphism means multiple forms. Polymorphism means having more than one function with the same name but with different functionalities. Polymorphism is of two types:
1. Static polymorphism is also known as early binding.
2. Dynamic polymorphism is also known as late binding.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is Data binding?
- hr@izetam.com February 02, 2022 in United States
Data binding is a process of binding the application UI and business logic. Any change made in the business logic will reflect directly to the application UI.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is Abstraction?
- hr@izetam.com February 02, 2022 in United States
Abstraction is a technique of showing only essential details without representing the implementation details. If the members are defined with a public keyword, then the members are accessible outside also. If the members are defined with a private keyword, then the members are not accessible by the outside methods| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersEncapsulation:
- hr@izetam.com February 02, 2022 in United States
Encapsulation is a technique of wrapping the data members and member functions in a single unit. It binds the data within a class, and no outside method can access the data. If the data member is private, then the member function can only access the data.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersAdvantages of C++?
- hr@izetam.com February 02, 2022 in United States
C++ is a highly portable language means that the software developed using C++ language can run on any platform.
C++ is an object-oriented programming language which includes the concepts such as classes, objects, inheritance, polymorphism, abstraction.
C++ has the concept of inheritance. Through inheritance, one can eliminate the redundant code and can reuse the existing classes.
Data hiding helps the programmer to build secure programs so that the program cannot be attacked by the invaders.
Message passing is a technique used for communication between the objects.
C++ contains a rich function library.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
Answers9. What is C++?
- hr@izetam.com February 02, 2022 in United States
C++ is an object-oriented programming language created by Bjarne Stroustrup. It was released in 1985.
C++ is a superset of C with the major addition of classes in C language.
Initially, Stroustrup called the new language "C with classes". However, after sometime the name was changed to C++. The idea of C++ comes from the C increment operator ++.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is the difference between shallow copy and deep copy?
- hr@izetam.com February 02, 2022 in United States
The difference between shallow copy and a deep copy is given below:
Shallow copy stores the references of objects to the original memory address,Deep copy makes a new and separate copy of an entire object with its unique memory address.
Shallow copy is faster,Deep copy is comparatively slower.
Shallow copy reflects changes made to the new/copied object in the original object,Deep copy doesn’t reflect changes made to the new/copied object in the original object| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is a copy constructor?
- hr@izetam.com February 02, 2022 in United States
A copy constructor is a member function that initializes an object using another object of the same class.
Example-
class A{
int x,y;
A(int x, int y){
this->x=x;
this->y=y;
}
};
int main(){
A a1(2,3);
A a2=a1; //default copy constructor is called
return 0;
}
We can define our copy constructor. If we don’t define a copy constructor then the default copy constructor is called.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersDefine inline function
- hr@izetam.com February 02, 2022 in United States
If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time. One of the important advantages of using an inline function is that it eliminates the function calling overhead of a traditional function.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat are the C++ access specifiers?
- hr@izetam.com February 02, 2022 in United States
In C++ there are the following access specifiers:
Public: All data members and member functions are accessible outside the class.
Protected: All data members and member functions are accessible inside the class and to the derived class.
Private: All data members and member functions are not accessible outside the class.| Report Duplicate | Flag | PURGE
C C++ - 0of 0 votes
AnswersDifference between struct and class?
- hr@izetam.com February 02, 2022 in United States
In C++ a structure is the same as a class except for a few differences like security. The difference between struct and class are given below:
Structure Class
Members of the structure are public by default. Members of the class are private by default.
When deriving a struct from a class/struct, default access specifiers for base class/struct are public. When deriving a class, default access specifiers are private.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat are class and object in C++?
- hr@izetam.com February 02, 2022 in United States
A class is a user-defined data type that has data members and member functions. Data members are the data variables and member functions are the functions that are used to perform operations on these variables.
An object is an instance of a class. Since a class is a user-defined data type so an object can also be called a variable of that data type.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is the difference between C and C++?
- hr@izetam.com February 02, 2022 in United States
The main difference between C and C++ are provided
C is a procedure-oriented programming language. C++ is an object-oriented programming language.
C does not support data hiding. Data is hidden by encapsulation to ensure that data structures and operators are used as intended.
C is a subset of C++ ,C++ is a superset of C.
Function and operator overloading are not supported in C. Function and operator overloading is supported in C++
Namespace features are not present in C Namespace is used by C++, which avoids name collisions.
Functions can not be defined inside structures. Functions can be defined inside structures.
calloc() and malloc() functions are used for memory allocation and free() function is used for memory deallocation. new operator is used for memory allocation and deletes operator is used for memory deallocation.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat are the different data types present in C++?
- hr@izetam.com February 02, 2022 in United States
The 4 data types in C++ are given below:
• Primitive Datatype(basic datatype). Example- char, short, int, float, long, double, bool, etc.
• Derived datatype. Example- array, pointer, etc.
• Enumeration. Example- enum
• User-defined data types. Example- structure, class, etc.| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
Answers25. What is an infinite loop?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers24. What is lvalue and rvalue?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers23. What is indirection?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers22. Select the incorrect operator form in the following list(== , <> , >= , <=) and what is the reason for the answer?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers21. Explain the purpose of the ‘delete’ operator?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers20. What information is given to the compiler while declaring a prototype function?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers19. What is the output of the following code snippet?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers18. What do you understand by calloc()?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answers17. What is FIFO?
- hr@izetam.com February 02, 2022 in India| Report Duplicate | Flag | PURGE
C