
A Beginner’s Checklist
Beginners and even experienced programmers who switch to a new compiler suddenly discover that their programs don’t compile anymore. Sometimes the programs compile but produce numerous warning messages. In most
Beginners and even experienced programmers who switch to a new compiler suddenly discover that their programs don’t compile anymore. Sometimes the programs compile but produce numerous warning messages. In most
Don’t forget that MS compiler initiates pointers with 0xCCCCCCCC value. In this case: void *p; … //do something here… if (p!=NULL) delete p; // Memory violation The right way void*
The sprintf() function isn’t type-safe, it doesn’t support user-defined types and it’s a common source of buffer overflow bugs. In C++, there’s a better alternative to sprintf(), namely stringstream objects.
Sizeof is a useful operator because it reports both the amount of memory that data items take and the number of bytes that data types. For instance: cout
It is unfortunate that VB5 does not provide a quick way to check if an item with a certain key exists in a collection. This results in errors if an
Whenever a thread is created in a program, it is unknown when it will execute. This means there may be cases where the parent program has finished but the thread
This is a fast, efficient way to make a split function. For longer strings, performance can be improved by enlarging AllocUnits. Public Function Split(strText As String, _Optional Byval Delimited As
Extracting the extension of a filename is a requirement in many file searches and file I/O related applications. A simple way to do this is to use the split function.
Suppose you have an abstract class MyAbstractClass with an abstract method do(): abstract class MyAbstractClass {abstract void do() ;} Of course, some classes inheriting from MyAbstractClass can be redefined with