Tip Bank

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

String tokenizing

Question: I often need to split a string into a number oftokens based on delimiters specifiedby the user. I would appreciate information on how to tokenize a string in a

DevX

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

DevX

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

DevX

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;