Question
In C, use the following requirements to modify p0.c Only modify p0.c p0.h : int str_length(char *s); int str_isalpha(char *s); void str_copy(char *to, char *from);
In C, use the following requirements to modify p0.c
Only modify p0.c
p0.h :
int str_length(char *s); int str_isalpha(char *s); void str_copy(char *to, char *from); void str_censor(char *sp, char *bad); void str_concat(char *base, char *suffix);
p0.c :
#include "p0.h" /* returns the number of characters in the sequence pointed to * by first arg, excluding the null terminator. I.e., * does the same thing as the library function strlen(). */ int str_length(char *s) { /* YOUR CODE HERE */ }
/* returns true (nonzero) iff every character in the sequence * pointed to by sp is a letter of the alphabet (i.e., either * in the range through or through ). */ int str_isalpha(char *s) { /* YOUR CODE HERE */ }
/* copies the contents of the character sequence indicated by from * (including the null terminator) into the space indicated by to. */ void str_copy(char *to, char *from) { /* YOUR CODE HERE */ }
/* modifies the string pointed to by sp by replacing each character * that is in the sequence with a space character . */ void str_censor(char *sp, char *bad) { /* YOUR CODE HERE */ }
/* appends the string pointed to by suffix to the string pointed to by base */ void str_concat(char *base, char *suffix) { /* YOUR CODE HERE */ }
------------------------------------------------------------------------------------------
You can test p0.c using simplep0driver.c :
#include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started