Question: This is a function for removing non alphabetic characters, but when added --i , the program stuck. C program. void strPK(char* src, char* dst) {

This is a function for removing non alphabetic characters, but when added --i , the program stuck.

C program.

void strPK(char* src, char* dst) { for (int i = 0; ; ++i) { if (src[i] == '\0') break; if (!((src[i] >= 'A' && src[i] <= 'Z') || (src[i] >= 'a' && src[i] <= 'z'))) { --i; //not working continue; } dst[i] = src[i]; } }

Here is my code:

#include #include

void strPK(char* src, char* dst) { for (int i = 0; ; ++i) { if (src[i] == '\0') break; if (!((src[i] >= 'A' && src[i] <= 'Z') || (src[i] >= 'a' && src[i] <= 'z'))) { --i; //not working continue; } dst[i] = src[i]; } }

int strCmpPk(char* s1, char* s2) {

}

int main() { char str[100]; char cpy[100]; printf("first string : "); fgets(str, 100, stdin);

strPK(str, cpy); printf("second string : %s", cpy);

return 0; }

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!