3

I am new to C#. I am writing a program in which a list changes size depending on user input. The list is of GPS coordinates so it is

List<double[]> coordinates= new List<double[]>();

However I have a function that needs the GPS coordinates in double[][] format, an array of arrays. It seems like this would be very straightforward because it seems like a list of arrays is already an array of arrays. However, the most logical thing I can think to do fails:

double[][]test = new double[][]{};

test = coordinates.ToArray;

with "Cannot convert method group 'ToArray' to non-delegate type 'double[][]'. Did you intend to invoke the method?"

Not sure what that means or how to fix. Any advice is appreciated.

1
  • 3
    You need parenthesis after ToArray. Thats the first problem. It should be ToArray() Commented Apr 12, 2013 at 15:27

2 Answers 2

10

To call a method in C#, you need to use parentheses, like this: test = coordinates.ToArray();

Sign up to request clarification or add additional context in comments.

Comments

4

You forgot the parenthesis:

double[][]test = coordinates.ToArray();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.