0

My textbook showed this piece of C++ code to run however when I run it on net beans it displays this error Exception in thread "main" ArrayIndexOutOfBoundsException: 0

#include <iostream>

using namespace std;

int main(void)
{ 
  cout << "Hello world";
  return 0; 
}
Edi
  • 1,900
  • 18
  • 27
  • Read [this C++ reference](https://en.cppreference.com/w/cpp), the documentation of your C++ compiler, perhaps [GCC](http://gcc.gnu.org/) to be invoked as `g++ -Wall -Wextra -g`. Then read the documentation of your debugger, perhaps [GDB](https://www.gnu.org/software/gdb/). You could be interested in installing [Debian](https://debian.org/) and [GNU emacs](https://www.gnu.org/software/emacs/) on your computer. – Basile Starynkevitch Jan 26 '21 at 10:24
  • Take also inspiration from existing C++ open source code, like [FLTK](http://fltk.org/), [RefPerSys](http://refpersys.org/), or [fish](https://fishshell.com/), [Qt](http://qt.io/) – Basile Starynkevitch Jan 26 '21 at 10:27

1 Answers1

2

there is no java.lang.ArrayIndexOutOfBoundsException in c++

that error is because netbeans is running another java project instead.

rightclick on the c++ project and click on "close others..." then you can work on the right one.

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97