D
Digital Fart
I have the following function that returns a struct
public struct layout
{
public string str;
public int i;
}
function in some class where i loop through an arraylist of structs
public layout getLayout(string s)
{
foreach ( layout l in layoutArray)
if ( l.str == s ) return l;
}
but this does not compile because when i can't find l.str == s
what should i return then?
public struct layout
{
public string str;
public int i;
}
function in some class where i loop through an arraylist of structs
public layout getLayout(string s)
{
foreach ( layout l in layoutArray)
if ( l.str == s ) return l;
}
but this does not compile because when i can't find l.str == s
what should i return then?