int[] bytes = new int[9] { 123, 5, 65, 123, 6, 77, 123, 4, 101 };
int count = 1;
for (int i = 1; i < bytes.Length; i++)
{
if (bytes[i] == 123)
{
count++;
}
else
{
Console.WriteLine(bytes[i]);
}
}
Console.ReadLine();
Im a beginner in programming.
The 123 is some type of "marker"
I dont know how to do a console output like this: 65 65 65 65 65 77 77 77 77 77 77 101 101 101 101
I would appreciate any help
To decode anything, you really need a specification of what that something is. In this case, I could speculate that:
so you would parse one byte, if it isn't 123: give up because you don't have any other rules to follow, but otherwise, read X and Y, and output X copies of the value Y
In pseudo-code: