Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Make a function called \"Allocate\" that would allocate a pointer to a dynamic a

ID: 3624968 • Letter: M

Question

Make a function called "Allocate" that would allocate a pointer to a dynamic array of pointers which would in turn point to a dynamic array of characters. It is okay to use cin>> in this function. Also, find a way to print all the addresses of the double pointer and each element of the array of pointers. Also make a print function. Make this into a complete program with main function

somebody pleaseee answer it soon!! i need it bad!! will rate lifesaver! and please make sure it works! thank you!

Explanation / Answer

#include <iostream.h>

void Allocate()
{
char **s;
char *p[5];
s=new char* [5];
for(int i=0;i<5;i++)
{
s[i]=new char[4];
cout<<" enter word "<<(i+1)<<": ";
cin>>s[i];
p[i]=s[i];
cout<<endl<<s<<" at "<<(int)p[i];
}

}

int main()
{
Allocate();
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote