Differences between default(int) vs int = 0

Effectively, there is no difference. According to MSDN

Specifies the default value of the type parameter. This will be null
for reference types and zero for value types.

int is a value type, so the expression will resolve to 0.

I would perform the explicit 0 assignment as its a lot more readable.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)