Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Should BasketOfApples derive from BasketOfFruit? Why or why not?
Given the following classes
class Fruit {
// …
}
class Apple : public Fruit {
// …
}
class Peach : public Fruit {
// …
}
// Container of fruit
class BasketOfFruit {
BasketOfFruit() ;
void insert( Fruit & f ) ;
// …
}
// Container of apples
class BasketOfApples /* ??? */ {
// …
}
Should BasketOfApples derive from BasketOfFruit?
Why or why not?
What is the general principle
that determines the answer?
----------------------------------------------
Describe briefly what the following function does.
What standard function is it most like ?
int f( char *p ) {
int n = 0 ;
while ( *p != 0 ) n = 10*n + *p++ - ‘0? ;
return n ;
}
-------------------------------------------
Describe briefly what function ‘a’ does in
the following code fragment.
struct s {
struct s *next ;
}
a( struct s *p, struct s *x ) {
while ( p->next != 0 ) p = p->next ;
p->next = x ;
x->next = 0 ;
}
--------------------------------------------
What default methods are declared implicitly
by the C++ compiler for the class below:
class Empty
{
};
-----------------------------------------------
✍: Guest
2012-05-14, 3936👍, 0💬
Popular Posts:
Regarding C Coding Given: Line in file Contents 30 int * someIDs, theFirst, *r; 110 someIDs =GetSome...
it will be very helpful if you send some important Questions with Answers of DBMS Tell us what types...
.NET INTERVIEW QUESTIONS - What is Suspend and Resume in Threading ? It is Similar to Sleep and Inte...
How To Increment Dates by 1? - Oracle DBA FAQ - Understanding SQL Basics If you have a date, and you...
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...