Skip to content

Commit 69e4ef2

Browse files
committed
added includes
1 parent 12fb5d5 commit 69e4ef2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

public/data/cpp.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
"title": "Reverse String",
77
"description": "Reverses the characters in a string.",
88
"code": [
9-
"string reverseString(const string& input) {",
10-
" string reversed = input;",
11-
" reverse(reversed.begin(), reversed.end()); // Using STL's reverse function",
9+
"#include <string>",
10+
"#include <algorithm>",
11+
"",
12+
"std::string reverseString(const std::string& input) {",
13+
" std::string reversed = input;",
14+
" std::reverse(reversed.begin(), reversed.end());",
1215
" return reversed;",
1316
"}"
1417
],

0 commit comments

Comments
 (0)