

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.








Question: Is there a function that will format a string for number or, say, $$ display? For example: format 1000000 to 1,000,000? Answer: No, the C standard has no such
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
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
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&)
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
Question: How can I code a Visual C++ program that will execute a DOS bat file? Or any other executable file, for that matter? Answer: Use the system() function. This
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
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)();
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
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
Question: I have to read in integers and be able to add them to the front of the array. How do I do this? Answer: You can either use the
Question: We use NT 4 WS as the client to our PeopleSoft (Oracle) application, and we need to pick off the information contained on the panel fields. We can easily
Question: How do I reboot (with an option to force) inside of Win NT? I know about the ExitWindowsEx API call, which works fine in Windows 95, but unfortunately this
Question: I am using the GetFileVersionInfoSize, GetFileVersionInfo, and VerQueryValue APIs to get the file version of third-party applications. In all cases, GetFileVersionInfoSize returns a large number, but when I query
Question: Please kindly advise how to output to a PC’s I/O port address: &H158 using Visual C++ under NT 40. For your information, we used to use outp() using C
Question: If I ftp to an AS400, I can run a program on it by typing quote rcmd call . Is it possible for me to do the same thing
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
Question: I have a VB app that was running on Windows 95 and using the scheduler included with Microsoft Plus. All was well. Now our company is switching to an
Both C and C++ enable you to store and access data directly in the tiniest possible unit: a bit. This technique is required when dealing with a huge amount of
Dynamic binding, for example, having a virtual member(s), is one of the basic principles of OO programming. If the compiler can resolve a call to a virtual member function statically,
Once declared virtual, a member function can be overridden in any level of derivation, as long as the overriding version has the identical signature of the original declaration. This is
The C/C++ register keyword can be used as a hint to the compiler that the declared variable is to be accessed very often during program execution, and hence, should be
An object’s member functions (both virtual and non-virtual) can be called from its constructor. The invoked virtual is guaranteed to be the one defined in the current object (or higher,
A static member function in a class can access only other static members of a class or variables which are not members of its class. It can be invoked even
C++ supports Run-time Type Identification (RTTI), which enables detection of actual object type during program execution using the built-in typeid() operator. Here is an example: //file: classes.hclass base{ base(); virtual
In object-oriented programming (OOP), global objects are considered harmful. Particularly in C++, there’s even more reason to think twice before using them: a global object construction occurs before a program’s
A const member or a reference member cannot be initialized within an object’s constructor. Instead, they must be initialized in the constructor’s member-initializer list. Conceptually, mem-initialization takes place before the
Unions are used to minimize memory waste. For example, consider the following database-transaction class used to update a person’s data. The key can be either a unique ID number or
Question: How can I get the Windows 95 print dialog box todisplay instead of the print setup dialog usingprintsetup()? Answer: You have to build your own custom dialog window. The
Question: I have been reading Visual C++ 5 in 21 Days while trying to learn how to use the Visual C++ user interface, and I have been trying to find

