+ 2

What is PrintBarr(...) in C#?

Can someone please explain what does PrintBarr function do in C# and what is the difference between consolewritline and printbarr?

6th Aug 2019, 5:07 AM
Sez Sem
Sez Sem - avatar
3 odpowiedzi
+ 7
C# doesn't seem to have a built-in method called "PrintBarr". Whatever you've read is most likely a user-defined function. Searching online returned something like this, a method written to print a BitArray. static void PrintBarr(string name, BitArray ba) { Console.Write(name + " : "); for (int x = 0; x < ba.Length; x++) Console.Write(ba.Get(x) + " "); Console.WriteLine(); } https://code.sololearn.com/c6u3V5As2frG/?ref=app
6th Aug 2019, 5:30 AM
Hatsy Rei
Hatsy Rei - avatar
0
thank you for answering. That makes alot more sense.
9th Aug 2019, 2:25 PM
Sez Sem
Sez Sem - avatar
0
I only seen it used to represent BitArrays in the Console. BitArray ba3 = new BitArray(5); ba3.SetAll(true); PrintBarr("ba3", ba3); //Console Result. ba3 : True True True True True
12th Dec 2020, 6:11 PM
NICK ISPANOPOULOS