Short Note
Short Note
QUES10.
QUES11.
LITERALS: -
Literals are data used for representing fixed values. They can be used
directly in the code.
Here's a list of different literals in C++ programming.
1. Integers
An integer is a numeric literal(associated with numbers) without any
fractional or exponential part. There are three types of integer literals in C
programming:
• octal (base 8)
2. Floating-point Literals
3. Characters
4. Escape Sequences
5. String Literals
QUES12.
What is implicit conversion in C++?
QUES15.
Access Specifiers in a class decide the accessibility of the class members, like
variables or methods in other classes. That is, it will decide whether the class
members or methods will get directly accessed by the blocks present outside the
class or not, depending on the type of Access Specifier.
There are three types of access SPECIFIERS IN C++:
This keyword is used to declare the functions and variables public, and any part of the entire
program can access it. The members and member methods declared public can be accessed
by other classes and functions.
The public members of a class can be accessed from anywhere in the program using
the (.) with the object of that class.
The private keyword is used to create private variables or private functions. The private
members can only be accessed from within the class. Only the member functions or the friend
functions are allowed to access the private data of a class or the methods of a class.
The protected keyword is used to create protected variables or protected functions. The
protected members can be accessed within and from the derived/child class.
QUES17. inheritance
ADVANTAGES: -
1. less code is required
2. promotes code reusability
3. Inheritance can save time and effort
4. Inheritance supports the concept of reusability
Types:-
getline() is a standard library function in C++ that is used to read a line of text
from an input stream and store it as a string
write() function shall attempt to write nbyte bytes from the buffer pointed to by
buf to the file associated with the open file descriptor, fildes.
• Objects
• Abstraction
• Polymorphism
• Inheritance
• Encapsulation
3. Game Development:
The try statement allows you to define a block of code to be tested for errors
while it is being executed.
Types of Polymorphism
• Compile-time Polymorphism
• Runtime Polymorphism
1. Compile-Time Polymorphism
This type of polymorphism is achieved by function overloading or operator
overloading.
A. Function Overloading
When there are multiple functions with the same name but different
parameters, then the functions are said to be overloaded,
B. Operator Overloading
C++ has the ability to provide the operators with a special meaning for a
data type, this ability is known as operator overloading
2. Runtime Polymorphism
This type of polymorphism is achieved by Function Overriding. Late binding
and dynamic polymorphism are other names for runtime polymorphism.
A. Function Overriding
Function Overriding occurs when a derived class has a definition for one of
the member functions of the base class. That base function is said to be
overridden.
B. Virtual Function
A virtual function is a member function that is declared in the base class
using the keyword virtual and is re-defined (Overridden) in the derived class
QUES36. standard libraries used in C++?
The Standard C++ Library can be categorized as follows: