Tip Bank

DevX - Software Development Resource

Initializing a Const Member

Question: I’m trying to initialize a const declared in a class. How do I do this? This example fails: class MyClass {private: const int A;}MyClass::MyClass () { A = 1;}

DevX - Software Development Resource

Templates and Nested Classes

Question: What is the C++ syntax for defining a function that belongs to a nested class that is contained within a template class? For example: template class A{ protected: //

DevX - Software Development Resource

All About Bool.h

Question: In my computer science class our teacher wants us to find information about Bool.h, which is supposedly in C++. No one in my class can find anything. Also, we

DevX - Software Development Resource

Eight-Byte Data Types

Question: I am looking for a data type in C++ that takes eight bytes. I have tried long, long int, and so forth, but they are all four bytes on

DevX - Software Development Resource

Array of Objects

Question: I have two questions. How do I pass an array of objects as an argument? How do I fix an error like “do or while loops are not expanded

DevX - Software Development Resource

Memory Stack vs. Free Store

Question: When using C++, is it better to use stack or free store memory for data objects of medium to large size? I have multiplatform concerns on the answer. The

DevX - Software Development Resource

Implicit Function Declaration

Question: I am a Computer Science student, and I am trying to compile a program where I use multiple files and my own header file for the first time. But

DevX - Software Development Resource

Exporting Templates Under C++

Question: How do I create a template library so that I can export templates and use them in different programs? Answer: I’m not sure I understand what you mean by