SinFluxx
SinFluxx
CC#
Created by manu on 4/15/2024 in #help
✅ implementing bond of life feature (genshin)
6. Do not post content offering or requesting compensation, including recruitment
11 replies
CC#
Created by peacies on 3/31/2024 in #help
Recommended resources for setup and learn C#
$getstarted
5 replies
CC#
Created by SCOLANATOR on 3/19/2024 in #help
Unable to add new columns to CSV file
Is the error a secret?
105 replies
CC#
Created by Androzeta on 3/17/2024 in #help
In the simplest terms possible, what *is* a constructor?
public string Foo would imply a method named Foo that returns a string whereas a constructor is always [optional access modifier] [name]([parameters])
9 replies
CC#
Created by Androzeta on 3/17/2024 in #help
In the simplest terms possible, what *is* a constructor?
Because constructors don't have return types
9 replies
CC#
Created by JohnWick on 3/19/2024 in #help
✅ VS Code
$close
5 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
so you'd instead need to do something like:
string line;
int lineIndex = 0;

using (var sr = new StreamReader(oFD.OpenFile()))
while ((line = sr.ReadLine()) != null)
{
// inner for loop goes here using
lineIndex++;
}
string line;
int lineIndex = 0;

using (var sr = new StreamReader(oFD.OpenFile()))
while ((line = sr.ReadLine()) != null)
{
// inner for loop goes here using
lineIndex++;
}
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
it's fine to use
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
You wouldn't be accessing the lines from the file using an array if you're using StreamReader, no. Is StreamReader something you have to use?
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
i.e. you can use File.ReadAllLines() to read the whole file into an array, and use the for loops as above to loop through each line
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
ok so file_lines is just a hypothetical name you might give to a variable where you're storing the contents of the file. And to use that way of doing things you'd read the whole file up front, rather than StreamReader where you'd read the file line-by-line
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
(someone else can jump in even if the original person isn't around)
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
yeah
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
i.e. you need to: - get the data from the file - loop through each line of the data - loop through each character of each line - insert each character into your 2d array
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
you might be getting too caught up on the pseudocode, pseudocode is there to provide a "high level" explanation of what should be done in your actual code
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
Or you can still use streamreader and just read it line by line
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
Well that's what I explained to you already:
You read all the lines to start with into file_lines
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
I was just explaining what you were doing in your existing code 🙂
57 replies
CC#
Created by Array on 3/19/2024 in #help
Reading in a File 2D Arrays
What part are you thinking may need hardcoding?
57 replies