This commit is contained in:
2025-11-30 01:51:19 +03:00
commit 37237f67f8
12 changed files with 191 additions and 0 deletions

24
charP.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <iostream>
using namespace std;
int countX (const char *p, const char *x) {
if (p==nullptr) {
return 0;
}
int count = 0;
for (; *p != 0; p++) {
if (*p == *x) {
count++;
}
}
return count;
}
int main (void) {
cout << countX("Haaay, Koray", "a") << endl;
return 0;
}