Programs and Guide for you

Programs and Guide for you

Share

We provide you guide in your c++ and c projects and if you want the complete projects,they are also available at reasonable prices.

17/06/2015

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

16/06/2015

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.

15/06/2015

Daily question #4
To use toupper() and tolower() functions in c++,we need to include
A:
B:
C:
D:

15/06/2015

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;

Want your business to be the top-listed Computer & Electronics Service in Karachi?
Click here to claim your Sponsored Listing.

Website

Address


Karachi