`Inline Code Example Here
What is the output of the following code:

int x;
int*p;
int*q; 
p = new int [10] ;
q = p;
*p = 4;

for (int j = 0; j<10; j++)
{
x = *p;
p++;
*p = x + j;
}
for (int k = 0; k<10; k++)
{
cout << *q << " ";
q++;
}
What is the output of this code?

Why dont you run it an find out?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.