Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The limitation on my program is that i am not allowed to use the string library, and need to create my own string functions. M

The limitation on my program is that i am not allowed to use the string library, and need to create my own string functions. My strcmp function is working fine, but my strlen keeps producing an error message. Here is my program:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

How can I fix the fucntion/program to get it to work?

#include 2#include stdlib.h> 4 char intersperse(char stringi char *string2)1 s size-t length! = strlen(string1); 6 size t Length2 strlen(string2); 7 char *string3 malloc(lengthl+length2+1) 10 while (string2[k] !='10' 66 stringi [j]!="V0' ){ if (string1j]0) 12 13 14 15 16 17 18 19 20 string2 [1] string1 [j]; if (string2[k] ') ( string3[i] string2[k]: 23 24 25 26 string3 [1] = ' \0' ; 27 return string3; 28 29 31 char widen stars (char stringl char string2) 32 size t lengthl strlen(string1): 33 size-t length2 strlen(string2) ; 34 char string3malloc(2 (engthl+length2+1)); 35 int i=e' j = ? , k=0; 36 37 while (string2[k]|s"10' 66 string1[j]|s.??. H 38 39 40 41 42 43 if (string1[j] !="Ye . ){ string3[i] string1lj1: j++i 45 string3[i] 46 i++, 47

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions