devxlogo

Tip Bank

DevX - Software Development Resource

Return type _Cdecl

Question: I have seen that in many of the header files in C++ the return type is _Cdecl. For example, in complex.h, we have the following: friend complex _Cdecl acos(complex&)

DevX - Software Development Resource

Quick sort

Question: I have pseudocode for a quick sort. I know how to implement it in Pascal. Is there simple code for quick sort in C++? How can I find other

DevX - Software Development Resource

Sorting in a ListView

Question: I would like to know how to program a Custom Sort procedure on a ListView in Borland’s C++ Builder. Answer: Normally, the ListView control will sort items automatically for

DevX - Software Development Resource

C++ equivilant of Basic MID$

Question: I need to test for a certain char in a char array.For example, in BASIC I would have: if mid$(string,1,1) = “`” then blah blah blah…. How would I

DevX - Software Development Resource

Pointers to member functions

Question: I am having lots of trouble calling a class member function pointer that is declared within the same class. So far the following compiles: class testClass {public: void (testClass::*ptr)();

DevX - Software Development Resource

Performance—C vs C++

Question: What are the performance tradeoffs of using C++ instead of C? Are there any ways of overcoming these tradeoffs? Answer: In general, C++ is every bit as efficient as

DevX - Software Development Resource

Functions and parameters

Question: I know this may sound like a dorky question, but can you explain to me?as if I were a little kid?what are functions, and why and how are parameters

DevX - Software Development Resource

Integer lengths

Question: What function gives the actual length of an integer or long integer? For instance, 8 is 1 long, 12345 is 5 long, etc. Answer: Use the sizeof() operator to

DevX - Software Development Resource

Automatic logon problems in NT 3.51

Question: We are running a SCADA package on an NT 3.51 machine at a mine. Since we often have power failures, the PC reboots itself and then requires the operator