fix(docs/cpp): fix error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]

This commit is contained in:
Gonglja
2023-01-12 07:08:56 +08:00
parent e318c495f7
commit 5cc58c7b91
5 changed files with 6 additions and 6 deletions

View File

@ -68,7 +68,7 @@ public:
vector<int> toVector() {
ListNode* node = front;
vector<int> res(size());
for (int i = 0; i < res.size(); i++) {
for (size_t i = 0; i < res.size(); i++) {
res[i] = node->val;
node = node->next;
}