Solution to Write a program to demonstrate the use of pointer to pointer. Make a list of … - Sikademy
Author Image

Archangel Macsika

Write a program to demonstrate the use of pointer to pointer. Make a list of characters (a word) by char *word, another list of words (a sentence) using char **sentence. Print the sentence using a double pointer.

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


using namespace std; /* Write a program to demonstrate the use of pointer to pointer.  Make a list of characters (a word) by char *word, another list of words (a sentence) using char **sentence.  Print the sentence using a double pointer. */ int main() { char w[] = "Hello World"; char *word, **sentence; int r; word  = &w[0]; sentence = &word; cout<<"\n\tWord = "<<w;     cout<<"\n\tWord available at *ptr = "; for(r=0;r<11;r++) cout<<*(word+r);     cout<<"\n\tSentence available at **sentence = "; for(r=0;r<11;r++) cout<<*(sentence+r); return(0); }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1118-qpid-114