vscode c++写hello world程序

首先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

猜你喜欢

转载自blog.csdn.net/lc574260570/article/details/82669834