Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <string.h>
- using namespace std;
- const size_t N = 120;
- char* mystrchr(char arr[]);
- int main() {
- typedef char cha[N];
- system("chcp 1251 > null");
- cha A;
- char key = 's';
- char *result;
- cout << "ΠΠ²ΠΎΠ΄: ";
- gets_s(A);
- result = mystrchr(A);
- cout << result;
- return 0;
- }
- char* mystrchr(char A[N])
- {
- int i = 0;
- char* j;
- while (A[i] != '\0') {
- if (A[i] == 's') {
- j = &A[i];
- return j;
- }
- i++;
- }
- return nullptr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement