The problem here is that you're local variable called bytesss is not being initialized before you try to concatenate to it. Doing this is similar to trying to concatenate a string to null, it just doesn't make any sense. Consider the following code.
string bytesss = null;
bytesss += ",";
or to put it another way...
string bytesss = null + ",";
Neither of these things make sense, so you need to make sure bytesss is set to some initial value before trying to concatenate. For example:
string bytesss = "";
or
string bytesss = string.Empty;
Lastly, there's a few other things you can do to make your code easier. If you're using a recent version of the .NET framework and have LINQ you can do something like this:
string mybytes(int[] sbytes)
{
return string.Join(",", sbytes.Select(i => IntToHex(i)).ToArray());
}
or if you're using an older version you could do something like this:
string mybytes(int[] sbytes)
{
List<string> list = new List<string>();
foreach(int i in sbytes)
list.Add(IntToHex(i));
return string.Join(",", list.ToArray());
}
bytesss += ...opcode do?