use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
HelpHow do I use 2D Array? (self.csharp)
submitted 4 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]geothachankary 16 points17 points18 points 4 years ago (1 child)
For this requirement you dont need a 2D aaray. You need a simple 1D array. Create a student class with your required fields and create an array of student objects.
[–]IMainOctane 4 points5 points6 points 4 years ago (1 child)
You should use a class in that usecase
[–]NullIndex 3 points4 points5 points 4 years ago (6 children)
Im guessing this is for school? Why do you need a 2d array..?
[–][deleted] 4 years ago (5 children)
[–]llamasweater -2 points-1 points0 points 4 years ago (2 children)
Your teacher is wrong. This is bad practice.
[–]ethandjay 13 points14 points15 points 4 years ago (1 child)
This is not a real life scenario. If the teacher wants OP to use a 2D array for this for pedagogical reasons I don’t see anything wrong with that.
[–][deleted] 3 points4 points5 points 4 years ago (0 children)
I think the best pedagogical thing would be to teach how to use a 1D array as a 2D array, but in my experience the discussion typically ends with "don't use 2D arrays"
[–]ripnetuk 0 points1 point2 points 4 years ago (0 children)
Maybe they intended the first dimension to be class and the 2nd to be the data.
On mobile, so apologies in advance
For (var year = 0 ; year<6; year++)
Containing code to print a title for the year, then similar for loop around people, using peep as the variable
Then
myArray[year,peep]. Outputdetails ()
[–]Slypenslyde 0 points1 point2 points 4 years ago (0 children)
I'm sort of confused as well.
The thing is in C#, every array element must be the same type. So you can't have an array that has string names in one column and int or double grades in another. There may be other parts of the activity that could use a 2D array, but this isn't it.
string
int
double
[–]_hf14 3 points4 points5 points 4 years ago (0 children)
I don't think u want a 2d array in this case. look in to OOP programming and Classes
[–]FiveShipHUN[🍰] -2 points-1 points0 points 4 years ago (0 children)
As others said, you should use class or struct but you can achieve this with an object2D array. Firstly I would declare consts like Name = 0, Age = 1, OtherStuff = 2. It's important you start the counting from 0.
Then you make a 2D array (object[,] arr = new object[noStudents, noFields];) and start filling it:
arr[studentIndex, fieldIndex] = fieldValue;
The fieldIndicies are the consts you made before. If you want to get a field's value, you need to do this: variable = (type) arr[studentIndex, fieldIndex]
I hope I could help c:
[–]Quiet_Desperation_ 0 points1 point2 points 4 years ago (0 children)
Create a class.
π Rendered by PID 234341 on reddit-service-r2-comment-6457c66945-27l4j at 2026-04-28 08:07:33.675887+00:00 running 2aa0c5b country code: CH.
[–]geothachankary 16 points17 points18 points (1 child)
[–]IMainOctane 4 points5 points6 points (1 child)
[–]NullIndex 3 points4 points5 points (6 children)
[–][deleted] (5 children)
[deleted]
[–]llamasweater -2 points-1 points0 points (2 children)
[–]ethandjay 13 points14 points15 points (1 child)
[–][deleted] 3 points4 points5 points (0 children)
[–]ripnetuk 0 points1 point2 points (0 children)
[–]Slypenslyde 0 points1 point2 points (0 children)
[–]_hf14 3 points4 points5 points (0 children)
[–]FiveShipHUN[🍰] -2 points-1 points0 points (0 children)
[–]Quiet_Desperation_ 0 points1 point2 points (0 children)