How can I use C++ in Linux?

How can I use C++ in Linux?
Answer
Writing your First C++ Program on Linux
  1. From your terminal, open a new file for editing using the vim command: vim hello.cc.
  2. In the vim editor, type the following code: #include
    <iostream>
    using namespace std; int main() { cout << "Hello, this is my first C++ program on Linux" << endl; return 0; }
    </iostream>
  3. Save and exit the file.
 

Tìm kiếm

Back
Top