Question: In C language: (1)Using Design by Contract, update the following to be robust and reliable char * concat( const char * s1, const char *

In C language:

(1)Using Design by Contract, update the following to be robust and reliable

char * concat( const char * s1, const char * s2 ) {

char * result = malloc( strlen( s1 ) + strlen( s2 ) + 1);

strcpy( result, s1 );

strcat( result, s2 );

return result; // caller has to free later

}

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!