<< < 2 3 4 5 6 7 8 >   Sort: Date

What is an adaptor class or Wrapper class? C++
What is an adaptor class or Wrapper class? C++ A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non-object-oriented implementation.
2012-01-09, 2685👍, 0💬

What is the software Life-Cycle?
What is the software Life-Cycle? The software Life-Cycle are 1) Analysis and specification of the task 2) Design of the algorithms and data structures 3) Implementation (coding) 4) Testing 5) Maintenance and evolution of the system 6) Obsolescence
2012-04-12, 2683👍, 0💬

Referring to the sample code above, on which one of the following lines does an initializer list occur?
1: class Foo { 2: int size; string name; double value; 3: 4: public: 5: Foo() : size(0), name("unknown"), value(0.0) { 6: } 7: Foo(int s) { 8: size = s; name = "unknown"; value = 0.0; 9: } 10: Foo(int s = 0, string n = "unknown", double v=0) { 11: size = s; name = n; value = v; 12: } 13: }; Referrin...
2012-04-26, 2680👍, 0💬

What is a COPY CONSTRUCTOR and when is it called?
What is a COPY CONSTRUCTOR and when is it called? A copy constructor is a method that accepts an object of the same class and copies it’s data members to the object on the left part of assignement: class Point2D{ int x; int y; public int color; protected bool pinned; public Point2D() : x(0) , y(0) {...
2012-02-14, 2680👍, 0💬

Write a program that ask for user input from 5 to 9 then calculate the average
Write a program that ask for user input from 5 to 9 then calculate the average #include "iostream.h" int main() { int MAX = 4; int total = 0; int average; int numb; for (int i=0; i&lt;MAX; i++) { cout &lt;&lt; "Please enter your input between 5 and 9: "; cin &gt;&gt; numb; while ...
2012-01-27, 2679👍, 0💬

What is polymorphism? Explain with an example?
What is polymorphism? Explain with an example? "Poly" means "many" and "morph" means "form". Polymorphism is the ability of an object (or reference) to assume (be replaced by) or become many different forms of object. Example: function overloading, function overriding, virtual functions. Another exa...
2012-02-24, 2675👍, 0💬

What problem does the namespace feature solve?
What problem does the namespace feature solve? Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link with two or more such libraries. The namespace feature surrounds a library’s external declarations with a unique namespace tha...
2012-03-22, 2674👍, 0💬

You’re given a simple code for the class BankCustomer. Write the following functions ...
You’re given a simple code for the class BankCustomer. Write the following functions ... You’re given a simple code for the class BankCustomer. Write the following functions: * Copy constructor * = operator overload * == operator overload * + operator overload (customers’ balances should be added u...
2012-03-01, 2674👍, 0💬

What is polymorphism? C++
What is polymorphism? C++ Polymorphism is the idea that a base class can be inherited by several classes. A base class pointer can point to its child class and a base class array can store different child class objects.
2012-01-17, 2673👍, 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, 2672👍, 0💬

How do you write a function that can reverse a linked-list?
How do you write a function that can reverse a linked-list? Answer1: void reverselist(void) { if(head==0) return; if(head-&lt;next==0) return; if(head-&lt;next==tail) { head-&lt;next = 0; tail-&lt;next = head; } else { node* pre = head; node* cur = head-&lt;next; node* curnext = ...
2012-01-17, 2668👍, 0💬

Name some pure object oriented languages. C++
Name some pure object oriented languages. C++ Smalltalk, Java, Eiffel, Sather.
2012-01-13, 2663👍, 0💬

In the derived class, which data member of the base class are visible?
In the derived class, which data member of the base class are visible? In the public and protected sections.
2012-01-23, 2659👍, 0💬

Name some major differences between C++ and Java.
Name some major differences between C++ and Java. C++ has pointers; Java does not. Java is platform-independent; C++ is not. Java has garbage collection; C++ does not. Java does have pointers. In fact all variables in Java are pointers. The difference is that Java does not allow you to manipulate th...
2012-04-10, 2657👍, 0💬

What is the two main roles of Operating System?
What is the two main roles of Operating System? As a resource manager As a virtual machine
2012-01-23, 2655👍, 0💬

Why are arrays usually processed with for loop?
Why are arrays usually processed with for loop? The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a c...
2012-02-29, 2652👍, 0💬

Referring to the sample code above, what is the type of T2 in the object ::f?
template&lt;class T = int&gt; class Foo { public: template&lt;class T2 = T&gt; class InnerFoo { T2 t2; }; static InnerFoo&lt;long&gt; *f; }; Foo&lt;double&gt; f; Referring to the sample code above, what is the type of T2 in the object ::f? 1) double 2) t2 3) char 4) i...
2012-04-20, 2651👍, 0💬

What is a scope resolution operator?
What is a scope resolution operator? A scope resolution operator (::), can be used to define the member functions of a class outside the class.
2012-02-23, 2646👍, 0💬

What’s the output of the following program? Why?
What’s the output of the following program? Why? #include &lt;stdio.h&gt; main() { typedef union { int a; char b[10]; float c; } Union; Union x,y = {100}; x.a = 50; strcpy(x.b,\"hello\"); x.c = 21.50; printf(\"Union x : %d %s %f \n\",x.a,x.b,x.c ); printf(\"Union y :%d %s%f \n\",y.a,y.b,y.c)...
2012-02-27, 2645👍, 0💬

What do you mean by pure virtual functions?
What do you mean by pure virtual functions? A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero. class Shape { public: virtual void draw() = 0; };
2012-02-24, 2642👍, 0💬

Define a constructor - What it is and how it might be called (2 methods).
Define a constructor - What it is and how it might be called (2 methods). Answer1 constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized. Ways of calling constructor: 1) Implicitly: automat...
2012-02-03, 2638👍, 0💬

What is function overloading and operator overloading?
What is function overloading and operator overloading? Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When...
2012-01-25, 2636👍, 0💬

What problems might the following macro bring to the application?
What problems might the following macro bring to the application? #define sq(x) x*x
2012-03-02, 2635👍, 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, 2628👍, 0💬

<< < 2 3 4 5 6 7 8 >   Sort: Date