Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool strcmp(char *str1, char *str2)
- {
- bool result=true;
- int i = 0;
- while ((str1[i] != '\0')&&(str2[i] != '\0'))
- {
- if (str1[i] != str2[i])
- {
- result=false;
- break;
- }
- else i++;
- }
- return result;
- }
- void strcopy(char *str1, char *str2)
- {
- int i = 0;
- while (str1[i] != '\0')
- {
- str2[i] = str1[i];
- i++;
- }
- cout << "Копирование выполнено\n";
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- char *str1[100];
- char *str2[100];
- char *copy[100];
- *str1 = "Ксюша\0";
- *str2 = "программист\0";
- cout<<strcmp(*str1, *str2)<<endl;
- strcopy(*str1, *copy);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement