May 1, 1997

C++ Classes

Question: I have written a program with two classes. Each uses the other within it and contains pointers to the other. However, this means that the first class encountered by the compiler has no previous class to use, so I get errors. How can I overcome this? Answer: This problem

Array of structures

Question: I have a typedef structure that holds info for employees, and an array of these structures. I need to access a part of the structure for one employee. How can I do it using the dot operator?My structure is called employee. It hold strings of the first and last

Class constructor

Question: I’ve read that there are two ways to define a class constructor. For example:class List…1. List():num(0) { }2. List() { num=0; }Why is the first one more efficient at runtime? Answer: Actually it is more that an issue of efficiency, it is also one of choice or requirement. A

A problem with a class Screen

Question: I found on the Web a simple class Screen as follows: /*———————————————— * s c r e e n . h * * A class to manage an ANSI text screen. Allows moving to * an x, y location and clearing the screen. * * Copyright 1996 by Interface