Hello guys.

I am getting this error when I run this file. Can any of you clarify what is wrong in the code?

public class csector_node


    {
        public double [] relations;
        public csector_node()
        {
            relations = new double [8];
            for (int i = 0;i < 8;i++)
            {
                relations[i] = new double[8];
                relations[i] = 0;
            }
        }
    }






Error:

incompatible types
            relations[i] = new double[8];
                           ^
  required: double
  found:    double[]
1 error

Process completed.

relations[] is an array of double.

relations[i] is just a double, not an array of double. It is, of course, not compatible to double[8] which is an array of double.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.