Question: The following are different programs that implement pointers. What would be the result of each ? Explain in details the concept of each line of
The following are different programs that implement pointers. What would be the result of
each Explain in details the concept of each line of below codes.
#include
using namespace std;
int main
Assume that the address of the variable a FAA
int a;
int aPtr;
a ;
aPtr &a;
cout &a endl;
cout aPtr endl;
cout a endl;
cout aPtr endl;
cout &aPtr endl;
cout &aPtr endl;
return ;
#include
using namespace std;
int main
int num num;
int mypointer;
mypointer #
mypointer ;
mypointer #
mypointer ;
cout "firstvalue is num endl;
cout "secondvalue is num endl;
return ;
#include
using namespace std;
int main
int firstvalue secondvalue ;
int pp;
p &firstvalue;
p &secondvalue;
p;
pp;
p p;
p;
cout "firstvalue is firstvalue endl;
cout "secondvalue is secondvalue endl;
return ;
#include
using namespace std;
void doubleitint p
p p ;
void doubleitint n
n n;
int main
int var ;
int pvar &var;
cout pvar
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
