#include <iostream>
using namespace std;
void ReverseStr(char* str)
{
int len = strlen(str);
for (int i = 0; i < len/2; i++)
{
swap(str[i], str[len - i - 1]);
}
}
void StrCat(char* dst, char* src)
{
int len = strlen(src);
int lenDst = strlen(dst);
for (int i = 0; i < len; i++)
{
*(dst + len + i) = src[i];
}
}
int StrCmp(char* str1, char* str2)
{
while (*str1 != '\0' || *str2 != '\0')
{
if (*str1 < *str2)
{
return -1;
}
else if (*str1 > *str2)
{
return 1;
}
else
{
str1++;
str2++;
}
}
return 0;
}
int main()
{
char str[100] = "HELLO";
cout << strlen(str) << endl;
char str1[100] = "WORLD";
StrCat(str, str1);
cout << str << endl;
ReverseStr(str);
cout << str << endl;
char a[100] = "abc";
char b[100] = "abcd";
cout << StrCmp(a, b) << endl;
return 0;
}