diff options
| author | jdhao <jdhao@hotmail.com> | 2021-08-22 01:12:44 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-08-22 01:12:44 +0800 |
| commit | 008831e5c22d37ee595d926b6a6116e2443a7c25 (patch) | |
| tree | 5640d1cd5c1cf9e0914ce994175947441194f7c1 | |
| parent | 13cc96c00b4bd26d451e49936ae039558333ebd7 (diff) | |
update cpp snippets
| -rw-r--r-- | my_snippets/cpp.snippets | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/my_snippets/cpp.snippets b/my_snippets/cpp.snippets index 004bcd1..1ddf414 100644 --- a/my_snippets/cpp.snippets +++ b/my_snippets/cpp.snippets @@ -24,10 +24,10 @@ endsnippet snippet plist "print vector" w template <class T> void printList(const T& arr, const string& desc){ - std::cout << desc << ": "; + std::cout << desc << ": ["; for (auto it = arr.begin(); it != arr.end(); it++){ - std::cout << *it << ((std::next(it) != arr.end()) ? ", " : "\n"); + std::cout << *it << ((std::next(it) != arr.end()) ? ", " : "]\n"); } } endsnippet |
