Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-3.(20) String Functions-Trace the following code 1 void answer (char *szstrl, char .szstr10 char srBuffer(40), cArr(40 int 1, count-, Index3] strepy(szBuffer, szstrl) if(szBuffer[ 1e Index[

image text in transcribed

image text in transcribed

-3.(20) String Functions-Trace the following code 1 void answer (char *szstrl, char .szstr10 char srBuffer(40), cArr(40 int 1, count-, Index3] strepy(szBuffer, szstrl) if(szBuffer[ 1e Index[ count] i 12 13 14 15 16 17 18 19 2e 21 cArr[count] - szBuffer(i 1) count++ switch(count) ( case e: case 1: strcpy(szstr2, szstr1) break case 2: case 3: 23 24 25 26 27 28 strncpy(SZStr2, szStr1, index[0]+1); strncat(szStr2, cArr, count-1) strcat(szstr2, szstri-(index[ count-1)) break default strepy(szStr2, "Not Implemented") 29return 30 31 32 int main)( char szArr1[40]"Tom Marvolo Riddle" 34 5 36 37 char szArr2[40] "Albus Percival Wulfric Brian Dumbledore" char szArr3[40), szArr4[40) answer(szArr1, szArr3) ; printf("a. is In", szArr3) 19 answer (szArr2, szArr4)j printf("b" %s ", szArr4); 1 2 return rite the program's output in the box below. Please show triangles for -3.(20) String Functions-Trace the following code 1 void answer (char *szstrl, char .szstr10 char srBuffer(40), cArr(40 int 1, count-, Index3] strepy(szBuffer, szstrl) if(szBuffer[ 1e Index[ count] i 12 13 14 15 16 17 18 19 2e 21 cArr[count] - szBuffer(i 1) count++ switch(count) ( case e: case 1: strcpy(szstr2, szstr1) break case 2: case 3: 23 24 25 26 27 28 strncpy(SZStr2, szStr1, index[0]+1); strncat(szStr2, cArr, count-1) strcat(szstr2, szstri-(index[ count-1)) break default strepy(szStr2, "Not Implemented") 29return 30 31 32 int main)( char szArr1[40]"Tom Marvolo Riddle" 34 5 36 37 char szArr2[40] "Albus Percival Wulfric Brian Dumbledore" char szArr3[40), szArr4[40) answer(szArr1, szArr3) ; printf("a. is In", szArr3) 19 answer (szArr2, szArr4)j printf("b" %s ", szArr4); 1 2 return rite the program's output in the box below. Please show triangles for

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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions