Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Adding string to snippets in vs code

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

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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"
}

}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!