array

  1. T

    Resolved count DataGridView numbers that match Array

    I have a text file that is generated daily and can contain several lines with 15 numbers drawn from 01 to 25 in each line, the text can have one line or several lines, it changes every day. I need to compare with an array 'Result' and count how many numbers in each line are equal to the numbers...
  2. Celso Calomeno

    Add txt file to a double list?

    If anyone can help me, I'm not able to convert the txt to include in the list string thePath = @"C:\Spectrum.txt"; string seq = File.ReadAllText(thePath); //read the numbers by line string[] text = Regex.Split(seq, "\t"); List<(double mz, double intensity)> ions = new List<(double mz...
  3. N

    Resolved How can I calculate the number of ships' of battleship games in the array?

    Need to calculate the number of ships. Ships are presented as a “battleship” game.“1” represents a ship, “0” represents water. C# namespace Ships { class Program { static int[,] ships = new int[10, 10] { { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }, { 0, 1...
  4. A

    Question Input string was not in the correct format

    I am writing a program to input and output a simple array. static void Main(string[] args) { int[] arr = new int[10]; Console.WriteLine("Enter nmber of elements"); int n = int.Parse(Console.ReadLine()); Console.WriteLine("Enter the...
  5. logan291g

    How can I swap sections of data in two different 2d arrays of the same length, forming a third (child) 2d array?

    I am extremely new to coding and I am currently learning C# on my own. I have searched around but I cannot find what I am looking for. I may not be searching for the correct terms. I am wondering how I could swap sections of 2 different 2d arrays, with each other, and form a new (child) 2d...
  6. Alexander Freyr

    Resolved Why can't you supply the array to a List<>?

    Since List<> is just a wrapper around an array why can't I supply the array through the constructor? It only allows a collection which is relatively expensive opposed to just handing it an array directly.
  7. Socarsky

    Convert a List<object> to a string[,] 2D array

    I am in a difficulty to convert a List that is class object which populated from database, so far so good to have that list of object but I need its string[,] (2D) array as converted to apply a method which helps to get an print output. private void dateTimePicker1_ValueChanged(object sender...
  8. M

    Question Pairing The Elements of 2 Array For Once

    Hello, I'm working on fixture project and trying to assign teams with each other.I have 18 teams and half of this is playing at home and the other half is playing at away.I created 2 structs.First struct is named "Teams" and holds the infos about each team(it's code is at below) public struct...
  9. R

    Index outside bounds of array

    Im making a game and after the first run run when the user clicks new game I get index outside bounds of array. This is the the new game button code panel1.Controls.Clear(); int x = int.Parse(heightentered.Text); int y =...
Back
Top Bottom