devxlogo

Tip Bank

How to Delete Dynamically Allocated Multidimensional Arrays

You can allocate a multidimensional array using new as follows: class A{public: int j;//…constructor, destructor, etc.}void func(){ int m; A (*pa)[2][2]=new A[2][2][2]; // three dimensional array m=pa[0][0][0].j; // access member

Clarifying a Common Source of Pointer Confusion

Novices, especially those who have experience with garbage-collected languages, are often confused with the concept of object deallocation and destruction in C++. They tend to explicitly invoke every object’s destructor

Duplicate Namespace Aliases

A definition of namespace alias can be used to redefine a previously defined namespace alias declared in that scope, as long as the new definition refers only to the same

Rotate Ads on WAP

Question: How do you integrate an ad-serving technology (such as one by Doubleclick that enables you to rotate ads on a regular Web page) onto a cell phone or PDA?

IIF Function Under SQL Server 7.0

Question: Is the IIF function valid under SQL server 7.0? It’s in the SQL Books Online as valid, but none of my stored procedures accept it. Answer: The IIF function

Container of Pointers

Many programmers believe that by storing pointers instead of objects in a container, they improve performance. However, they forget that the pointers still refer to existing objects that must be