• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array Problem  RSS feed

 
David Evangelista
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble putting an int value into an array. The error code I get at compile time is this: "error: array required, but int found". The following is snippets of my array initialization and the line producing the error.

Next, the line where the problem occurs. In this code "i" is an int variable that represents a place in the array fitness (this part of the code is within a for loop).


Thanks for the help!
 
Jain Pratik
Greenhorn
Posts: 14
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You created Array Variable and int variable with same name. Change the name of one of the variable. It will work.
 
Liutauras Vilda
Sheriff
Posts: 4921
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,

Please explain in simple English, what each line of your code does?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!