Question: #include #include #include // return the length of a string // For example, // return 0 if s is // return 3 if s
#include
// return the length of a string // For example, // return 0 if s is "" // return 3 if s is "abc" unsigned long my_strlen(char *s) { unsigned long i = 0;
while (*s ++) i ++; return i; }
/* This should shift the 'a' to 'b', 'b' to 'c', ..., 'z' to 'a', as well as the capital letters. Don't shift non-alphabetical characters. */ char shift_char(char x){
}
/** Returns a pointer to a new string which is * a copy of the given string s. */ char* dup_shift(char* s) { }
int main(int argc, char *argv[]) { char input[100]; printf("Enter a string: "); scanf("%[^ ]s", input); char* dups_ptr = dup_shift(input); printf("%s ", dups_ptr); free(dups_ptr); return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
