1. 程式人生 > >vscode c++寫hello world程式

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