More C++ Preprocessor Directives

June 5, 2007

The #pragma directive is a compiler specific directive which compiler vendors may use for their own purposes. For instance, a #pragma is often used to allow suppression of specific error messages, manage heap and stack debugging, etc. You can see the C# .Net equivalent here. In Microsoft Visual C++ 8 (Visual Studio 2005), one useful [...]

0

C++ Preprocessor Variables

May 17, 2007

I went several years programming in C/C++ without really knowing about these preprocessor variables. They can be very useful for debugging and logging of custom run time errors/warnings. I have not found a definitive list of them, but here is a list of some useful ones that I know of. (The following variables can vary [...]

1

C++ Notes: Shallow vs Deep Copies

April 16, 2007

A shallow copy of an object copies all of the member field values. This works well if the fields are values, but may not be what you want for fields that point to dynamically allocated memory. The pointer will be copied. but the memory it points to will not be copied — the field in [...]

0