devxlogo

Tip Bank

Verifying a Destructor’s Invocation

Conceptually, destructors of global objects are called after main() has exited. For this reason, many debugging and memory checking tools are confused and report phantom memory leaks or warn about

std::string and null Characters

Unlike C-strings, a std::string object may contain null characters in the middle of its internal buffer. For example: std::string s=

Self-referential Inheritance

Consider the following example: class A : public list < A >{ // …}; Does your compiler accept it? According to the Standard, using an incomplete type as a template

Viewing Error Outputs From Java Applets in IE

The file Java/Javalog.txt in the Windows directory (i.e. C:windowsJava.Javalog.txt for windows and C:winntJavaJavalog.txt for NT) contains information for the last applet that was loaded by Internet Explorer. This file contains

How to Access Cookies Set at the Client Side

Class javax.servlet.http.cookies can be used to access cookies on the client side. The following code demonstrates this technique. The code also checks for the cookie names in order to access