added cross-platform

This commit is contained in:
2023-12-03 15:31:50 +03:00
parent c4b8e2dd7a
commit 0afbb32788
7 changed files with 103 additions and 42 deletions

View File

@@ -3,7 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
class String {
friend String operator+(const String& a, const String& b);
@@ -17,14 +17,14 @@ public:
}
String(const char* s) {
length = strlen(s);
length = (long)strlen(s);
body = new char[length + 1];
for (long i = 0; i < length; ++i)
body[i] = s[i];
body[length] = '\0';
}
String(const char* s, char ps) {
length = strlen(s);
length = (long)strlen(s);
body = new char[length + 1];
for (long i = 0; i < length; ++i) {
body[i] = (s[i] == ps) ? '\n' : s[i];