我正在尝试设置visual studio代码以用c ++编程.我已经安装了扩展C/C++和C/C++ Intellisense
以下是我的代码:
#include<iostream>
using namespace std;
int main()
{
cout<< "hello" ;
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是identifier cout is undefined
当我把它写成std::cout
错误时,我得到的是namespace std has no member cout
.以下是我的task.json
档案:
{
"version": "0.1.0",
"command": "make",
"isShellCommand": true,
"tasks": [
{
"taskName": "Makefile",
// Make this the default build command.
"isBuildCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "always",
// No args
"args": ["all"],
// Use the standard less compilation …
Run Code Online (Sandbox Code Playgroud)