devxlogo

Tip Bank

Friend class and function

Question: I need to know what the class or function called “friend” is. My teacher explained it in class, but I don’t quite understand how to call it and declare

Inheritance and parameter pushing

Question: Why do I need private inheritance in C++?Is it true that (in C++) function parameters are pushed onto the stack from right to left? If so, why? Answer: Use

VC++ 5.0 and STL predicates

Question: How can I provide my own predicate for the list::sort method in Visual C++ 5.0? The method appears to require that any function object passed must be derived from

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

Storing strings in a char array

Question: This is actually a simpler form of the real problem I am dealing with. I have a array of char like so:char name[20];Then, I try to put a string

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

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

Manipulating and using large integers

Question: In several programs, I need to use integers larger than those that can be held by unsigned long ints. I need to be able to multiply, divide, and mod

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