I was trying to add a custom snippet but having a problem adding string to the snippet here is the code:
"Default cpp formate": {
"prefix": [
"include",
"default"
],
"body": [
"#ifndef ONLINE_JUDGE"
" freopen("input.txt", "r", stdin);"
" freopen("output.txt", "w", stdout);"
"#endif"
"$0",
""
],
"description": "This is a c++ snippet",
}
In the code the "input.txt" does not come when run the snippet
So finally this code worked using escape sequences "/" before every quotes
"Default cpp formate": {
"prefix": [
"include",
"default"
],
"body": [
"#ifndef ONLINE_JUDGE",
" freopen(\"input.txt\", \"r\", stdin);",
" freopen(\"output.txt\", \"w\", stdout);",
"#endif",
"$0",
""
],
"description": "This is a c++ sniffpet",
},
"for loop": {
"prefix": "forl",
"body": [
"for($1 $2 = $3 ; $2 < $4 ; $2++)",
"{"," ${0:/* code */}",
"}"
],
"description": "For Loop"
}
}