[Solved] how to print all words the end with ed? [closed]


The difference between the arrays:

The difference between double[] array = new double[a.Count - 2]; and double[] array = new double[a.Count]; is the length of the array you are declaring. When you are passing a integer value into the constructor of your new array that is the length your array will be initialized with.

Notes on array declaration and length:

This length cannot be changed after declaration and you must create a new array and copy elements to the new collection.

Value vs reference comparison:

As for your comparisons throughout your method, there is two primary forms of comparison, comparison by value and comparison by reference. Comparison by value returns true if the value of two objects (int, string, etc.) are the same. Comparison by reference returns true if two variables point to the same place in memory. You should be using the .Equals() method instead of “==”, this will assure you are comparing by value and not by reference.

Further Notes:

Also something to note that you will have to go out and research for yourself is length and count are not the same. The difference is covered here.

8

solved how to print all words the end with ed? [closed]