Topics Search

Dynamic casting

Dynamic casting
Views: 0
In this lesson, we’ll continue by examining another type of cast: dynamic_cast. When dealing with polymorphism, you’ll often encounter cases where you have a pointer to a base class, but you want to access some information that exists only in a derived class.
Sponsored Links:

Similar posts...

 

Casting in C++

Casting in C++ Icon
The new C++ standard is full of powerful additions to the language: templates, run-time type identification (RTTI), namespaces, and exceptions to name a few. This tutorial discusses one of the minor extensions: the new C++ casting operators.
 

Type Casting

Type Casting Icon
Converting an expression of a given type into another type is known as type-casting.
 

Implicit And Explicit Conversions In C#

Implicit And Explicit Conversions In C# Icon
In this article you will learn how readability of code can be improved with implicit and explicit operators. In my last article about type casting, I explained narrow and widening conversions along with as and is operators. In this article, we shall take casting to a whole new level. At the end, you will learn how readability of code can be improved with implicit and explicit operators.
 

MemServer : a dynamic memory allocation server

MemServer : a dynamic memory allocation server Icon
One of the most common operations while programming is the allocation of dynamic memory to store data, which is done by using routines like standard "C" malloc() and calloc() or C++ new operator. There is more than one good reason to use dynamic memory instead of static buffers in our programs, as an example, it allows to get buffer of a specific size which is known only at run-time. This way we can avoid to declare oversized buffers. Probably the most interesting aspect of dynamic allocated buffers is that they can be released once no more useful...
 

Advanced Memory Management: Dynamic Allocation, Part 1

Advanced Memory Management: Dynamic Allocation, Part 1 Icon
Dynamic allocation is one of the three ways of using memory provided by the C/C++ standard. To accomplish this in C the malloc function is used and the new keyword is used for C++.
 

Designing Types in C#. Basics You Need to Know About Classes

Designing Types in C#. Basics You Need to Know About Classes Icon
In this article, I will focus on how to define type in .NET using C#. I'll review the difference of reference types and values types, discuss about System.Object and type casting. Someone may want to see the explanation of encapsulation, inheritance and ploymorphism here. I decided to have a separate article for it as the next one in this series, so it is coming soon...
 

Dynamic Memory Allocation: Virtual Memory

Dynamic Memory Allocation: Virtual Memory Icon
Part 2 in a series on dynamic memory allocation and management
 

Introduction To Casting/Converting In C#

Introduction To Casting/Converting In C# Icon
A cast operator explicitly converts a value into a particular data type. For example, the following code initializes the double variable value1, casts it into the float data type, and then saves the new float value in variable value2. Converting a reference type to a direct or indirect ancestor class or interface. These sorts of conversions are done implicitly.
 

C++ Support for Code Writing

C++ Support for Code Writing Icon
We have been introduced to declaring variables using specific data types. After declaring a value and initializing it, you may want the value to change type without redefining it. This is required in some cases where you already have a value, probably produced by one variable, while another variable declared with a different data type. This means that you would need to convert a value from one type into another type. For example, you may have declared a variable using a double data type but you need the value of that variable to be used as an int. Transferring a value from one type to another is referred to as casting.
 

Entity Framework 7 - How to retrieve dynamic data

Entity Framework 7 - How to retrieve dynamic data Icon
A technique to return dynamic data from a SQL Query using Entity Framework 7... Given that I am using Entity Framework 7 and that I want to return data from a query, but not be bound to a DbSet object to run a report. Since CoreCLR doesn't have DataTables which were also a popular way to achieve this functionality previously, another method needed to be developed.