首先vscode是一个比较方便的东西,我们可以很方便的去使用并编写程序。
c++的相关的代码:
#include <iostream>
// if you writer a c++ program you must first have down :
//return type //function name //parameter list //function body
int main() //main function int is back type
{
std::cout << "hello world\n";
return -1; //return type
}
result:
[Running] cd "/Users/Desktop/" && g++ 1.cpp -o 1 && "/Users/Desktop/"1
hello world
[Done] exited with code=255 in 0.447 seconds