在VS代码中添加字符串
我试图添加一个自定义片段,但是在片段中添加字符串的问题是代码:
"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",
}
在代码中,“ input.txt”运行摘要时不会出现
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,最终,此代码在每个引号之前都使用逃生序列“/”来工作
}
So finally this code worked using escape sequences "/" before every quotes
}
摘要是在执行CP时节省时间的好方法。要回答您的问题,您可以使用下面的片段,也无需包含自定义标签空间。 \ t将为您添加选项卡空间。
Snippets are a good way to save time while doing cp. To answer your question you can use the snippet below and also there is no need to include custom tab spaces. \t will add tab spaces for you.