Question: Draw memory diagrams for point 1 and 2 : #include void funct ( const char x [ 8 ] , char y [ ] ,

Draw memory diagrams for point 1 and 2:
#include
void funct (const char x [8], char y[], int n);
int main()
{
// It is unusual to intialize a string with '\0' in the middle of string,
// but it's allowed and we did it delibrately for the educational pruposes.
const char* sc ="
\0map";
char sa[5]={'\0'};
while (*sc) sc++;
sc +=3;
// Point One
funct(sc, sa, &sa[5]- &sa[0]);
return 0;
}
void funct (const char x[8], char y[], int n)
{
while (n ){
y[0]= x[0];
n--;
x--;
y++;
}
// Point Two
}

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!