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
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
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