#include using namespace std; int main() { const char * s = "pointer"; char x = * (s + 4) + 3; int numbers[4]; int * p; p = numbers; for(int i = 0; i < 4; i++) { * (p + i) = 2 * i + l; } unsigned long d; d = (unsigned long) (p + 3); d = d - (unsigned long) &numbers[0]; %3D cout << x « endl; //1. cout « sizeof ("frog") « endl; //2. cout <« *numbers << endl; //3. cout << * (p + numbers[1]) <« endl; //4.
#include using namespace std; int main() { const char * s = "pointer"; char x = * (s + 4) + 3; int numbers[4]; int * p; p = numbers; for(int i = 0; i < 4; i++) { * (p + i) = 2 * i + l; } unsigned long d; d = (unsigned long) (p + 3); d = d - (unsigned long) &numbers[0]; %3D cout << x « endl; //1. cout « sizeof ("frog") « endl; //2. cout <« *numbers << endl; //3. cout << * (p + numbers[1]) <« endl; //4.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 3PE
Related questions
Question
i need answer of number 6 and an explanation why.
![#include <iostream>
using namespace std;
int main() {
const char * s = "pointer";
char x = * (s + 4) + 3;
int numbers[4];
int * p;
p = numbers;
for(int i = 0; i < 4; i++) {
* (p + i) = 2 * i + l;
}
unsigned long d;
(unsigned long) (p + 3);
d = d - (unsigned long) &numbers[0];
d =
cout << x « endl;
//1.
cout « sizeof("frog") « endl;
//2.
cout <« *numbers << endl;
//3.
cout << * (p + numbers[1]) <« endl;
//4.
cout <« d « endl;
//5.
return 0;](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F91868d1c-5d38-4cd0-94b7-fc9caf0f642a%2F6a722244-bbab-4544-bba2-dbb7d4982afe%2Fek15a2_processed.png&w=3840&q=75)
Transcribed Image Text:#include <iostream>
using namespace std;
int main() {
const char * s = "pointer";
char x = * (s + 4) + 3;
int numbers[4];
int * p;
p = numbers;
for(int i = 0; i < 4; i++) {
* (p + i) = 2 * i + l;
}
unsigned long d;
(unsigned long) (p + 3);
d = d - (unsigned long) &numbers[0];
d =
cout << x « endl;
//1.
cout « sizeof("frog") « endl;
//2.
cout <« *numbers << endl;
//3.
cout << * (p + numbers[1]) <« endl;
//4.
cout <« d « endl;
//5.
return 0;
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT