C
C#Ewan

✅ Why is it showing me this error?

i dont get why its out of range
No description
A
Angius17d ago
Well, processes is a multidimensional array The length of a multidimensional array is it's total length 14 in your case
E
Ewan17d ago
oh what what do i have to do to make it work? replace the proccesses.length with 14? but i dont want 14 values i just want it to print out all the second values from each thing
A
Angius17d ago
.GetLength(x) will get you the length of the xth dimension
E
Ewan17d ago
im not sure what to do to make mine work ;-;
M
MODiX17d ago
Angius
REPL Result: Success
int[,] arr = {
{1, 2},
{3, 4},
{5, 6},
{7, 8},
};
Console.WriteLine($"0: {arr.GetLength(0)}\n1: {arr.GetLength(1)}\ntotal: {arr.Length}");
int[,] arr = {
{1, 2},
{3, 4},
{5, 6},
{7, 8},
};
Console.WriteLine($"0: {arr.GetLength(0)}\n1: {arr.GetLength(1)}\ntotal: {arr.Length}");
Console Output
0: 4
1: 2
total: 8
0: 4
1: 2
total: 8
Compile: 450.482ms | Execution: 57.090ms | React with ❌ to remove this embed.
A
Angius17d ago
Here, fixed You want to iterate over the 0th dimension while keeping the 1st constant, at 1 If so, then loop until .GetLength(0) not until .Length
E
Ewan17d ago
ohhhhhhhhhhhhhhh i SEE ok it works now, i totally understand thank you!!
A
Angius17d ago
Nice Anytime
Want results from more Discord servers?
Add your server
More Posts
Database function skipping dataHello, when I run the below method it is supposed to return a string array with a list of users, butAssemblyLoadContext LoadfromAssemblyPath vs LoadFromNativeImagePathWhat is the difference between [LoadfromAssemblyPath](<https://learn.microsoft.com/en-us/dotnet/api/SpotifyAPI - i dont understand things but i want this so bad...With alot of Help from the internet i somehow managed to get to this code: (in picture) it is not ev✅ hey, can someone please fix this for me? it keeps giving me errors✅ WPF - how to approach a treeview displaying different types at different levels via MVVMI'm just learning WPF - so seeking some design advice. I'm designing a Visual Studio extension to viDoes hangfire has a redudant delay?I`ve created an Job that deletes object from db at certain time, but it looks like it is being delayhelp needed with accesing a variable in another scriptim trying to acces isgrounded in another script and have it be the same as hi but i get this errorIssue with websocket within a serviceIm having troubles using a websocket service within other parts of my projects, cannot use the Send HelpI'm new to C# in VSC and i have a Problem wich is why i can't execute the Code. What am i supposed t✅ Checking data from SQL databasehelp on verge of tears✅ How to export data from datagridview into excel fileI've tried like a few ways and cant really make sense of it, if someone can guide me through it it wProblem with Material Design Lib in wpfI have a Combobox item in Stack panel. Im using Material Desing for automatic styling but the Popup✅ Title: Issues with Authentication and Authorization using JWT with AutoRender Mode in Blazor NET8Hello friends, I am currently facing challenges with Authentication and Authorization using JWT wit✅ How do I reference a specific private instance of a classI would like to know how I could reference a specific instance of a class, if the class is private aReceiving Game Controller Input while Minimized (WinForms C#)Pretty general question here. How would I go about receiving input from my user while they aren't tprocess startIve been trying to figure out why the proccess.start() hasnt been working✅ Configurations say that appsettings is returning nullBasically, i have a configuration and i'm trying to access a value from my appsettings, and all that✅ ASP.NET Core Web Api + SignalRHi, I have an API deployed on IIS but when a person wants to access it they get an error: "ERR_CONNE✅ .NET sdk not workingSo, I've installed the .NET sdk and did what I was told, but it's still not being detected by vscodeMEF No exports were found that match the constraintHi, i'm trying to implement MEF in my WPF app, however i'm getting this error, not sure why anymore.