Tip Bank

DevX - Software Development Resource

Declaring Pointers to Member Functions

Pointers to member functions consists of the member function’s return type, the class name followed by ::, the pointer’s name, and the function’s parameter list. For example, a pointer to

DevX - Software Development Resource

Returning an Argument by Reference

Question: What exactly returns a C++ function if it returns an object by a reference like: Person& GetNextPerson(); Please explain at assembly level, if possible. Answer: Assembly speaking, such a

DevX - Software Development Resource

C++ Comments

Question: Why isn’t C commenting style preferred in C++? C commenting style definitely looks neater and more readable than the C++ commenting style. Answer: /* comments in C++ are just

DevX - Software Development Resource

Overloading The ! Operator

Question: Is it possible to have a postfix version of the ! operator? Answer: No, you cannot alter the associativity, ordering and position of built-in operators when you create an

DevX - Software Development Resource

Data Source Name Not Found Error ‘80004005’

Question: What does this error message mean? Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’ [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /SampleProject/default.asp,

DevX - Software Development Resource

Cross Platform Compilers

Question: Is there a C++ compiler that I can use to go cross-platform with development?I need to develop the same DLLs for AS400, Sun, and Windows. Answer: I’m not sure

DevX - Software Development Resource

Open ODBC Connection Without Hardcoding Password

Question: In my ASP page, I open an ODBC connection with: Set Conn = Server.CreateObject(“ADODB.Connection”)Conn.CommandTimeout = 600Conn.open “Database_name”,”Username”,”password”. How can I avoid hardcoding the password in the ASP source? Answer:

DevX - Software Development Resource

Compiler Warnings with STL Map Containers

Question: Using even the most basic default constructor, such as ” mapm; ” , causes a debug error creating huge compiler warnings in Visual C++ and MS Visual Studio 6.0.