Question: A C program contains the following declarations: char c = s ; char * str 1 = dragon ; char * str 2 = fly

A C program contains the following declarations:
char c =s;
char *str1=dragon;
char *str2=fly;
The following lines appear next in the program. Describe the effect of each
line. Explain your reasoning clearly in each case.
str1[1]=b;
*str2= c;
str1++;
*(str1+2)=r;
printf(%s
, str1);
strcpy(str1,str2);
printf(%s
, str1);
printf(%s
, str2);

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!