added cross-platform
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user