Never Return Pointers to Variables Allocated in the Stack
For example the following code is incorrect: const char *foo(){ char buf[1024]; strcpy(buf,
For example the following code is incorrect: const char *foo(){ char buf[1024]; strcpy(buf,
If you have coded a template class and use it from VC++, you will get a LNK2001 error message on template member functions. This is because Microsoft deviates a bit
To convert character strings into its integer component: #include int ConvertString(char * str){ int result = 0; for (int index = 0; index
The need to find the Icm is pretty common in C++ programming. This is just a basic code for finding the lcm of two integers: int lcm(int large, int small){
Quite often, we find ourselves using variables to hold one of a set of possible values. For instance, let’s say you have a number of views on a grid. You’ll
This tip is extremely useful in the IDE for debugging. Before the Do loop you want to make safe, you set the var ‘loopnum’ as 0. Then, place these two
Debugging ActiveX EXE components is different from debugging ActiveX DLL components, and a bit more difficult. Here is how to do it: 1. Run your ActiveX EXE component in the
Sometimes we may need to register/unregister a DLL or OCX programatically. This piece of code can do that. Private Declare Function RegisterDLLOCX Lib _
The following code is an efficient, flexible, system-setting-independent procedure. MonthNames is either a listbox or a combobox. If StartMonth is greater than EndMonth, the list of month names will be