Inheritance and Memory Allocation
Question: I can’t create an instance of the derived class using operator new. The base and the derived classes differ only by a virtual function. The error messages I receive
Question: I can’t create an instance of the derived class using operator new. The base and the derived classes differ only by a virtual function. The error messages I receive
Question: How can I declare a constant object that is actually constant? Answer: Here’s an example: const Date d; //create a const Date object Note that you can only invoke
Question: I am a beginner with C++ programming. I was doing fine until I came to the string data type. Here is my problem: #include #include This gives me errors.
Question: How can you caluculate interest using only integers and no double or floats? Answer: This question can be of interest for anyone who is confined to ineteger arithmetic. Many
To determine whether a String array contains a given item it seems that you can’t avoid writing a loop. However, you can do it with just one line of code,
Most API function that return a string require that you pass a buffer where they can place the result as a null-terminated ANSI string (a.k.a. ASCIIZ string). The calling code
You can often use the Replace function in a smewhat unorthodox ways to simplify (and sometimes optimize) your code. For example, in order to count the number of occurrences of
I find the Replace function very useful when I want to avoid too many append operations just to insert non-printable characters. For example, the following statement: MsgBox “Disk not ready.”
Visual Basic doesn’t provide any way to declare an array and initialize its elements at the same time. In most cases you end up with setting individual elements one by