Question: Im working with pointers in C++. I need a brief step by step explanation for this snippet of code and why it displays: BBB What

Im working with pointers in C++. I need a brief step by step explanation for this snippet of code and why it displays: BBB

What will be displayed? Describe each step of code, the related use of pointers, and how it results in that display.

#include

using namespace std;

#include

int main()

{

char* str[] = { "AAAAA", "BBBBB", "CCCCC", "DDDDD"};

char** sptr[] = { str + 3, str + 2, str + 1, str };

char*** pp;

pp = sptr;

++pp;

printf("%s", **++pp + 2);

return0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!