To create a simple C++ script in Ubuntu and other Ubuntu based distributions do the following
C++ should already be installed in your distribution, to check open your terminal and enter the following command
which cpp
If installed it will show you the path to cpp
/usr/bin/cpp
If C++ is not installed in your distribution, there will be no output from the terminal.
In this case we need to install C++, so please enter the following in your terminal
sudo apt-get install cpp
Once installed, we can now write and compile our first C++ script that will be executed through the terminal.
Create a new file on your desktop named myfirstscript.cpp
If not obvious the .cpp extension refers to c++
Open the file you just created in your distributions text editor, then copy and paste the code below.
#include <iostream>
int main ()
{
std::cout << "Hello, Welcome To My Computer Tips" <<std::endl;
return 0;
}
Next we need to compile and create an executable file.
Open your terminal and enter the following command