I Just wanted to get
#include<bits/stdc++.h>
using namespace std;
int main()
{
system("cls");
int t; cin>>t;
while(t--)
{
}
exit(0);
}
auto-complete snippet when i type #include in VS code
so inside cpp.json file of vs code added this
{
"Print to console": {
"prefix": "#include"
"body": [
"#include<bits/stdc++.h>"
"using namespace std;\n"
"int main()"
"{"
"system("cls");\n"
"int t; cin>>t;"
"while(t--)"
"{"
"\t $1"
"}"
"\t exit(0);"
"}"
],
"description": "basic structure for CP"
}
}
But when i get the snippet the "cls" word is not getting printed instead iam getting the output as
#include<bits/stdc++.h>
using namespace std;
int main()
{
system(
);
int t; cin>>t;
while(t--)
{
}
exit(0);
}
"cls" is missing.
can anyone help me sorting out the issue
you can even suggest me any other command or way to clear screen automatically before output using code itself
if any alternative for system("cls") in VS code which doesn't give me this problem when set in user snippet.
"characrer such that\". Also don't useusing namespace std;or#include <bits/stdc++.h>using namespace stdor#include<bits/stdc++.h>what is the problem in using this ?clsin snippet but it dont clear the screen assystem('cls');isnt a valid command !using namespace std;creates namespace pollution: stackoverflow.com/questions/1452721/….#include <bits/stdc++.h>increases compile time and file size not to mention that it is not standardc++. For quick programs where time is an issue (i.e. competitions) it's fine but it is generally very bad practice.