We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abca846 commit 6fb7d5eCopy full SHA for 6fb7d5e
1 file changed
C++/14_cppBeginners.cpp
@@ -0,0 +1,29 @@
1
+#include <iostream>
2
+#include <string>
3
+using namespace std;
4
+
5
+class BuckysClass{
6
+ public:
7
+ BuckysClass(string z){
8
+ setName(z);
9
+ }
10
+ void setName(string x){
11
+ name = x;
12
13
+ string getName(){
14
+ return name;
15
16
+ private:
17
+ string name;
18
+};
19
20
21
+int main()
22
+{
23
+ BuckysClass bo("Lucky Bucky roberts");
24
+ cout << bo.getName();
25
26
+ BuckysClass bo2("Sally mcSalad");
27
+ cout << bo2.getName();
28
+ return 0;
29
+}
0 commit comments