devxlogo

March 27, 1997

String handling in C++

Question: What is the best way to manipulate strings in C++? Answer: Here is an example.#include void foo (char *instring){ // Declare char array big enough to read in input

How to do large scalar math

Question: How can one do 64-bit or larger math calculations in C++? Do you know of a free class or class library that supports large scalar math? Answer: There are

Copy constructors

Question: I have a class with multiple parents. In my copy constructor, should I invoke the parents’ copy constructor or their default constructor? Answer: In all but the rarest of

Program compiles but does not show age data

Question: I’m anxious to know why my program is notdisplaying the data, yet it compiles perfectly.I want to read this struct; in particular: age. Ihave two sets of code that

Virtual Functons

Question: How are Virtual Functions implemented in C++ ? What is a virtual table? Answer: Let me start by saying that the C++ language definition does not impose any implementation