Added operator= integer operator.
This commit is contained in:
1 parent
9d62a09140
commit
8648ab3152
3 files changed
+21
-2
No files matched your search
+9
-1
@@ -139,7 +139,15 @@ namespace coreutils {
|
||||
cursor = this->data;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
MString &MString::operator=(int value) {
|
||||
std::string temp = std::format("{}", value);
|
||||
setSize(temp.length());
|
||||
memcpy(this->data, (char *)temp.data(), temp.length());
|
||||
cursor = this->data;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MString &MString::operator<<(const char *value) {
|
||||
int temp = length;
|
||||
int len = strlen(value);
|
||||
|
||||
Reference in new issue
Block a user