Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In C# what is the default value of the bytes when creating a new byte array?

Tags:

arrays

c#

The answer to this question has eluded my search.

When I do this:

  var authToken = new byte[16]; 

What is the value of authToken[0]?

Is it null or zero?

like image 762
Brian Leeming Avatar asked Mar 19 '14 12:03

Brian Leeming


People also ask

What does -> mean in C?

An Arrow operator in C/C++ allows to access elements in Structures and Unions. It is used with a pointer variable pointing to a structure or union. The arrow operator is formed by using a minus sign, followed by the greater than symbol as shown below.

What does %d do in C?

In C programming language, %d and %i are format specifiers as where %d specifies the type of variable as decimal and %i specifies the type as integer. In usage terms, there is no difference in printf() function output while printing a number using %d or %i but using scanf the difference occurs.


1 Answers

The default value is 0

For more information about default values:

http://msdn.microsoft.com/en-us/library/83fhsxwc.aspx

like image 63
ronaldm Avatar answered Oct 20 '22 20:10

ronaldm