Skip to content

Commit b944773

Browse files
committed
Add simple source code.
1 parent fcdb712 commit b944773

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin

helloworld.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <vector>
2+
3+
using namespace std;
4+
5+
class HelloWorld
6+
{
7+
public:
8+
void Print(ostream& stream)
9+
{
10+
vector<string> msg {"Hello", "C++", "World", "from", "VS Code!"};
11+
12+
for (const string& word : msg)
13+
{
14+
stream << word << " ";
15+
}
16+
}
17+
};

main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <iostream>
2+
#include "helloworld.cpp"
3+
4+
using namespace std;
5+
6+
int main()
7+
{
8+
HelloWorld hw;
9+
10+
hw.Print(cout);
11+
12+
cout << endl;
13+
}

0 commit comments

Comments
 (0)