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

Is C an object-oriented language?
Is C an object-oriented language? C is not an object-oriented language, but limited object-oriented programming can be done in C.
2012-04-10, 2915👍, 0💬

What do you mean by binding of data and functions?
What do you mean by binding of data and functions? Encapsulation.
2012-02-16, 2915👍, 0💬

What is the value of "count" immediately before the return statement above is executed?
int count=0; class obj { public: obj(){ count++; } ~obj() { count--; } }; main() { obj A,B,C,D ; return 0 ; } What is the value of "count" immediately before the return statement above is executed? 1) 0 2) 1 3) 2 4) 3 5) 4
2012-04-25, 2914👍, 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, 2912👍, 0💬

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, 2908👍, 0💬

What is a node class? C++
What is a node class? C++ A node class is a class that, * relies on the base class for services and implementation, * provides a wider interface to the users than its base class, * relies primarily on virtual functions in its public interface * depends on all its direct and indirect base class * can...
2012-01-13, 2907👍, 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, 2905👍, 0💬

What are the conditions that have to be met for a condition to be an invariant of the class?
What are the conditions that have to be met for a condition to be an invariant of the class? * The condition should hold at the end of every constructor. * The condition should hold at the end of every mutator (non-const) operation.
2012-01-12, 2905👍, 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, 2901👍, 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, 2896👍, 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, 2894👍, 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, 2892👍, 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, 2879👍, 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, 2877👍, 0💬

Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321]. quicksort ((data + 222), 100);
2012-02-20, 2877👍, 0💬

What do you mean by inline function?
What do you mean by inline function? The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increa...
2012-01-27, 2877👍, 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, 2875👍, 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, 2874👍, 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, 2863👍, 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, 2862👍, 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, 2861👍, 0💬

What’s the best way to declare and define global variables?
What’s the best way to declare and define global variables? The best way to declare global variables is to declare them after including all the files so that it can be used in all the functions.
2012-03-06, 2858👍, 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, 2852👍, 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, 2847👍, 0💬

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