C
C#2y ago
appi

✅ Custom class arrays, parameters, custom methods.

I am given an integer parameter, a custom class array, getters and setters. I must find the index of the given parameter, mark that index as null, and return it as true.
4 Replies
appi
appiOP2y ago
So far, I have tried just normally iterating through the array with a for loop and a foreach loop, both give me errors because of the custom class array
Anchy
Anchy2y ago
can you share the code you have tried and what the expected output should be
appi
appiOP2y ago
the expected output is true if the parameter was found, false if not. If true that index should be changed to null.
public static bool Placeholder(int num)
{
for(int i = 0; i < array.Length; i++)
{
if (array[i]
}
return false;
public static bool Placeholder(int num)
{
for(int i = 0; i < array.Length; i++)
{
if (array[i]
}
return false;
i have tried every variation of this i can think of, but i always get an error where the custom type for the array cant be used with int
Anchy
Anchy2y ago
what is the custom class you are referring to
Want results from more Discord servers?
Add your server