We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1faddfd commit ea9f978Copy full SHA for ea9f978
src/String.cpp
@@ -73,3 +73,11 @@ String& String::operator+=(String& s) {
73
str = newStr;
74
return *this;
75
}
76
+
77
+ostream& operator<<(ostream &out, String &s) {
78
+ for (int i = 0; i < s.size; i++) {
79
+ out << s.str[i];
80
+ }
81
82
+ return out;
83
+}
src/testString.cpp
@@ -1,14 +1,7 @@
1
#include "String.h"
2
3
-ostream& operator<<(ostream &out, String &s) {
4
- for (int i = 0; i < s.size; i++) {
5
- out << s.str[i];
6
- }
7
-
8
- return out;
9
-}
10
11
int main() {
12
String s;
13
String s2('H');
14
String s3("Hallo");
0 commit comments