Hello World in netbeans on unix at the University of Manchester

First open up netbeans by typing netbeans at a terminal command line or by finding it in the menus.

Open a new project (File > New Project), and select C/C++ Application.

Enter in the name for the project as HelloWorld, then simply click finish.

Now this has opened an empty project, and we need to add our new (or existing) C++ files to the project. No program is complete without a main function so we need a main file. Double click on the project name in the projects tab, you should see listings of the header, resource and source files. Right click on the source files icon and select New C++ Main File , you can just call the file main, click finish.

An empty main file is now created with no statements. Add the input/output library iostream and add the command

std::cout << " Hello World!!! " << std::endl

Now compile and run the code by pressing the green triangle button. You should see something like...


Return to Homepage