How to make a for loop for a class in C#

print(“Hello World”)

I was using the FPS1 tutorial set( and translating it to c#. I wanted make a gun manager. I made a class containing all necessary public variables and I made an array of classes.

Question: How do I go through this array? Thanks in advance

for loops are very easy, practically the same as they are in js.

for(int i = 0; i < classArray.Length; i++)
     classArray *= new ClassType();*

// or
ClassType item = classArray*;*

// item.functions(arguments);
// item.variables = values;
or if you don’t need to set the value if the array you can do a foreach
foreach(ClassType item in classArray)
//item.variables = values;