December 14, 1999

Another Technique for Assigning a Zero Value to All Members of a Struct

In addition to the technique described in tip #453, “Assigning A Zero Value to All Members of A Struct”, C++ (but not C) offers another method of assigning all the members of a struct to binary zeros at once. This method applies to small structs that occupy up to 8

Purpose of Placement delete

C++ defines a placement version of operator delete. Placement delete is not supposed to be called directly by the user. Rather, it merely serves as the deacllocation function that the implementation must invoke when an exception occurs during the construction of an object by placement new. To generalize, for every

Introducing Pointers to Members

Pointers to members are one of the most intricate syntactic constructs in C++, and yet, they are a very powerful feature too. In future tips, I will discuss pointers to members in further detail and show to define and use them. Uses of Pointers to MembersPointers to members enable you

Multithreading Misconceptions

While it is true that a multithreaded app is more responsive than a single threaded one, programmers who are new to multithreading are often misled into thinking that a multithreaded app executes faster. However, this is not always the case. On a machine that has a single CPU, adding threads

Avoiding Deferment of Global Object Construction

Consider the following class and its global instance: // Foo.h class Foo { public: Foo() { RegisterSelf(); } private: void RegisterSelf() {/**/} };// Foo.cpp #include “Foo.h” Foo reg; // global instance// main.cpp #include “Foo.h” int main() { } The global object reg may be optimized away during the link phase,

Recent Changes in the Specification of Open Mode Flags

In older stages of C++, the ios::nocreate and ios::noreplace open modes were part of the family of classes. However, the revised family of file manipulation classes, which should be used instead of the now deprecated , does not recognize these flags anymore. What happened to them? Along with the templatization

Finding the Max and Min in Consecutive Data

Question: I have a table in Microsoft Access 97 with sales info in the following format: Prod_Type, Box_Number, Cust_No.FA1111 , 400400 , 40010FA1111 , 400401 , 40010FA1111 , 400402 , 40010FA1111 , 400403 , 55555FA1111 , 400404 , 40010FA1111 , 400405 , 40010 When I write a report, I want

Exchange Rules Limit

Question: I am trying to set up 87 rules for a specific mailbox. Problem is, I get an error message stating there are too many rules. Is there a limit to how many rules a mailbox can have? If so, can this limitation be manually expanded? Answer: The limit in

Making the VFP Report Writer Accessible By VB

Question: I’m a Visual FoxPro 6.0 programmer and recently decided to use Visual Basic 6.0. Everything seemed to be fine in VB until it came to creating a report. The data reports provided by VB are too basic. Is there a way that VB can use the VFP Report Writer?

No more posts to show