Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions