//
archives

C

This tag is associated with 3 posts

Storing C++ Objects in a STL Vector Part 1

1. Introduction. 1.1 The STL vector is one of the most useful container classes in STL. 1.2 However, given a base class B, a class D derived from B, and a vector V of type B, it is not possible to store instances of D in V. 1.3 As will be shown later on with … Continue reading

Pointers to C++ Class Member Operators

1. Introduction. 1.1 In C++, it is possible to define a class member function type and thereafter declare variables of that type. 1.2 Note that it is also possible to define a class member operator type and thereafter declare variables of that type. 1.3 This article demonstrates how to do this with reference to a … Continue reading

Returning Strings from a C++ API to C#

1. Introduction. 1.1 APIs that return strings are very common. However, the internal nature of such APIs, as well as the use of such APIs in managed code, require special attention. This blog will demonstrate both concerns. 1.2 I will present several techniques for returning an unmanaged string to managed code. But before that I shall first provide an … Continue reading