Programs and Guide for you
We provide you guide in your c++ and c projects and if you want the complete projects,they are also available at reasonable prices.
Daily Question #6
what is the output of the following code?
using namespace std;
int x = 10;
void fun()
{
int x = 2;
{
int x = 1;
cout
Daily knowledge #4
Inheritance vs Aggregation,when to use inheritance or aggregation?
Ans:In normal cases:
* If The new class has almost the same functionality as the original class. Use inheritance. The new class is now a subclass of the original class.
* If the new class must have the original class. Use aggregation. The new class has now the original class as a member.
However,in some cases we have to use other tricks that comes by practice
* If we have to inherit only some part of original class, or we are forced to override a lot of functionality to keep the correlation logical during inheritance. Then aggregation is a good choice.
* If we use aggregation but we find out we need to copy almost all of the functionality. Then inheritance is a good choice.
Daily question #4
To use toupper() and tolower() functions in c++,we need to include
A:
B:
C:
D:
Daily knowledge #3
What are Lvalues and Rvalues?
Ans: lvalue : Expressions that refer to a memory location is called "lvalue" expression. An lvalue may appear as either the left-hand or right-hand side of an assignment.
rvalue : The term rvalue refers to a data value that is stored at some address in memory. An rvalue is an expression that cannot have a value assigned to it which means an rvalue may appear on the right- but not left-hand side of an assignment.
*Variables are lvalues and so may appear on the left-hand side of an assignment.
*Numeric literals are rvalues and so may not be assigned and can not appear on the left-hand side.
Following is a valid statement:
int g = 20;
But following is not a valid statement and would generate compile-time error:
10 = 20;
Click here to claim your Sponsored Listing.
Category
Website
Address
Karachi