July 18, 1997

Constructors and virtual functions

Question: I have been doing some programming in C++ and recently decided I would try some Windows programming with the Microsoft Foundation Classes. This isn’t a question about Windows but

Clearing character arrays

Question: How do you clear a character array? Answer: You can use the standard C library memset function. Here is an example:void foo (){ char t [20]; cin >> t;

Declaring a bit field for a variable

Question: Is there a way to explicitly declare the number of bits to allocate to a specific variable? For example, can I declare an integer that would be stored in

Helpful C/C++ newsgroups

Question: Do you know of any good C/C++ mailing lists? I’m a computer science major and I’d like to join one. Answer: I am not aware of any mailing lists

How portable is C++?

Question: How portable is C++ as a programming language (in terms of different operating systems andhardware)? Answer: C++ is a fairly new language that until recently did not specify anystandard

Using self-defined libraries

Question: I am using Borland Turbo C++ 3.1 and I can’t figureout how to use my self-defined libraries. I’ve used”#include” but I get an error every time I try touse

What to do with overload arguments

Question: Which arguments do you receive when you overload . and -> , and what do you do with the arguments? I know that for overloading [] you receive the

What is pure virtual function?

Question: Can you explain and give me examples of pure virtual function? What is the difference between pure virtual function and virtual function? Answer: A pure virtual function is a