Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago