<< < 1 2 3 4 5 6 7 8 > >>   Sort: Rank

Describe run-time type identification.
Describe run-time type identification. The ability to determine at run time the type of an object by using the typeid operator or the dynamic_cast operator.
2012-03-22, 2242👍, 0💬

What is the Standard Template Library (STL)?
What is the Standard Template Library (STL)? A library of container templates approved by the ANSI committee for inclusion in the standard C++ specification. A programmer who then launches into a discussion of the generic programming model, iterators, allocators, algorithms, and such, has a higher t...
2012-03-21, 2373👍, 0💬

What is an explicit constructor? C++
What is an explicit constructor? C++ A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. It’s purpose is reserved explicitly for construction.
2012-03-21, 2421👍, 0💬

What is a mutable member? C++
What is a mutable member? C++ One that can be modified by the class even when the object of the class or the member function doing the modification is const.
2012-03-20, 2342👍, 0💬

When is a template a better solution than a base class?
When is a template a better solution than a base class? When you are designing a generic class to contain or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unkn...
2012-03-20, 2248👍, 0💬

Explain the ISA and HASA class relationships. How would you implement each in a class design?
Explain the ISA and HASA class relationships. How would you implement each in a class design? A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. An Employee ISA Person. This relationship is best implemented with inheritance. Empl...
2012-03-19, 2606👍, 0💬

When should you use multiple inheritance?
When should you use multiple inheritance? There are three acceptable answers: "Never," "Rarely," and "When the problem domain cannot be accurately modeled any other way."
2012-03-19, 2328👍, 0💬

What is the difference between a copy constructor and an overloaded assignment operator?
What is the difference between a copy constructor and an overloaded assignment operator? A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.
2012-03-16, 2658👍, 0💬

What is a conversion constructor C++?
What is a conversion constructor C++? A constructor that accepts one argument of a different type.
2012-03-16, 2364👍, 0💬

What is a default constructor? C++
What is a default constructor? C++ Default constructor WITH arguments class B { public: B (int m = 0) : n (m) {} int n; }; int main(int argc, char *argv[]) { B b; return 0; }
2012-03-15, 2408👍, 0💬

How does throwing and catching exceptions differ from using setjmp and longjmp?
How does throwing and catching exceptions differ from using setjmp and longjmp? The throw operation calls the destructors for automatic objects instantiated since entry to the try block.
2012-03-15, 2314👍, 0💬

I write a program in C++ that asks the user for names of students and their cooresponding midterm scores ...
I write a program in C++ that asks the user for names of students and their cooresponding midterm scores ... I write a program in C++ that asks the user for names of students and their cooresponding midterm scores, at the end, it displays each person, their average, gpa, class ave, total a's, b's, e...
2012-03-14, 2384👍, 0💬

How many ways are there to initialize an int with a constant?
How many ways are there to initialize an int with a constant? Two. There are two formats for initializers in C++ as shown in the example that follows. The first format uses the traditional C notation. The second format uses constructor notation. int foo = 123; int bar (123);
2012-03-14, 3081👍, 0💬

What are the differences between a C++ struct and C++ class?
What are the differences between a C++ struct and C++ class? The default member and base-class access specifiers are different.
2012-03-13, 2293👍, 0💬

Explain the scope resolution operator.
Explain the scope resolution operator. It permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.
2012-03-13, 3364👍, 0💬

How do you link a C++ program to C functions?
How do you link a C++ program to C functions? By using the extern "C" linkage specification around the C function declarations.
2012-03-12, 2339👍, 0💬

How do I initialize a pointer to a function?
How do I initialize a pointer to a function? This is the way to initialize a pointer to a function void fun(int a) { } void main() { void (*fp)(int); fp=fun; fp(1); }
2012-03-12, 2193👍, 0💬

What does extern mean in a function declaration?
What does extern mean in a function declaration? It tells the compiler that a variable or a function exists, even if the compiler hasn’t yet seen it in the file currently being compiled. This variable or function may be defined in another file or further down in the current file.
2012-03-09, 2258👍, 0💬

How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters? Answer1 If you want the code to be even slightly readable, you will use typedefs. typedef char* (*functiontype_one)(void); typedef functiontype_one (*functiontype_two)(void); functi...
2012-03-09, 2355👍, 0💬

What is the difference between char a[] = “string”; and char *p = “string”; ?
What is the difference between char a[] = “string”; and char *p = “string”; ? Answer1 a[] = “string”; char *p = “string”; The difference is this: p is pointing to a constant string, you can never safely say p[3]=’x'; however you can always say a[3]=’x'; char a[]=”string”; - character array init...
2012-03-08, 2601👍, 0💬

What’s the auto keyword good for?
What’s the auto keyword good for? Answer1 Not much. It declares an object with automatic storage duration. Which means the object will be destroyed at the end of the objects scope. All variables in functions that are not declared as static and not dynamically allocated have automatic storage duratio...
2012-03-08, 2219👍, 0💬

What is the difference between char a[] = “string”; and char *p = “string”;?
What is the difference between char a[] = “string”; and char *p = “string”;? In the first case 6 bytes are allocated to the variable a which is fixed, where as in the second case if *p is assigned to some other value the allocate memory can change.
2012-03-07, 2393👍, 0💬

What can I safely assume about the initial values of variables which are not explicitly initialized?
What can I safely assume about the initial values of variables which are not explicitly initialized? It depends on complier which may assign any garbage value to a variable if it is not initialized.
2012-03-07, 2391👍, 0💬

What does extern mean in a function declaration?
What does extern mean in a function declaration? Using extern in a function declaration we can make a function such that it can used outside the file in which it is defined. An extern variable, function definition, or declaration also makes the described variable or function usable by the succeeding...
2012-03-06, 2326👍, 0💬

<< < 1 2 3 4 5 6 7 8 > >>   Sort: Rank