0% found this document useful (0 votes)
15 views3 pages

Unit 5 CH 3

The ANSI C++ standard added several new features including new data types (bool, wchar_t), new casting operators (static_cast, const_cast, etc.), class implementation changes with the explicit and mutable keywords, namespaces to define identifier scopes, and new operator keywords like && and ||. Some key additions were new data types for Boolean values and wide characters, casting operators for safer type conversions, and namespaces for better organizing code.

Uploaded by

JESTER GAMING
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views3 pages

Unit 5 CH 3

The ANSI C++ standard added several new features including new data types (bool, wchar_t), new casting operators (static_cast, const_cast, etc.), class implementation changes with the explicit and mutable keywords, namespaces to define identifier scopes, and new operator keywords like && and ||. Some key additions were new data types for Boolean values and wide characters, casting operators for safer type conversions, and namespaces for better organizing code.

Uploaded by

JESTER GAMING
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit 5 ch.

3 NEW FEATURES OF ANSI C++ STANDARD


Introduction -: The ANSI C++ standard add several new features to the original c++
specification. Some are added to provide better control in certain situation other are added for
providing convenience to c++ programmers.
The important features are here as like
1 . New data type

 Bool
 wchar_t
2. New Operators

 const_cast
 static_cast
 dynamic_cast
 reinterpret_cast
 typeid
3. class implementation
4. Namespace scope
5. Operator keyword
6.New keywords
7. New headers

New Data type-: The ANSI c++ added two new data type to enhance the range of data types
available in c++. They are BOOL and wchar_t.
The Bool data type– the data type bool has been added to hold boolean value true or false.
The value true and false have been added as keyword to the c++ language. the bool type
variable can be declared as follows as like

The wchar_r data type –: The character data type wchar_t has been defined in ANSI c++ to
hold 16 bit wide character. 16 bit character are used to represent the character set of language
that have more than 255 character.
ANSI c++ also introduce a new character literal known as wide_character literal which use
two bytes of memory. It’s start the letter L as like..
L'xy' //wide character

1
New Operators-: We have used several operator in several program of c++ language.We
know that the cast are used to convert the value from one type to another. This is necessary in
situation where automatic conversion are not possible.
The static_cast operator -: This operator is used for any standard conversion data type . It
can also be used to cast base class pointer into a derived class pointer. For like
static_cast <type>(object)
The const_cast operator-: It is used to explicitly override const or volatile in a cast . it takes
as like
const_cast<type>(object)
The reinterpret_cast operator-: this is used to change one type into a fundamentally different
type for example
reinterpret_cast<type>(object)
The dynamic cast operator-: It is used to type of an object at run-time. Its main application
is to perform cast on polymorphic object. as like
dynamic_cast <type>(object)
The typeid operator -: this operator is use to obtain the types of unknown object such as
their class name at runtime. for example
char *objectType =typeid(object).name();
Class implementation -: C++ add two unusual keywords Explicit and Mutable for use with
class member.
Explicit keyword-: It is use for declare class construction to be “explicit ” constructors.
Mutable keyword-: A class object or a member function may be declared as const thus
making their member data not modifiable.
Namespace scope –: C++ added added a new keyword namespace to define a scope that
could hold global identifiers. Example of in c++ are class , function and templates are
declared with the namespace namespace std.
Defining a namespace-: we can define a namespace in our program. the syntax for defining
a namespace is similar to the syntax as like
namespace namespace_name
{
//declaration
}
Operator keywords -: C++ has several operator keyword. these are the
&& and
!! OR

2
! NOT
!= NOT_EQ
& BITAND
| BITOR
^ XOR
~ COMPL
&= AND_E1
|= OR_EQ
^= XOR_EQ

You might also like