There are basically two ways of calling sizeof:

sizeof unary-expression
sizeof ( type-name )



Parentheses is not bad, when you are not sure whether to add it or
not, just add it.


For your case, you should put parentheses around type int, and also
you can leave arr without parentheses. In total, you can use below two
ways to express:

sizeof(arr) / sizeof(int)
sizeof arr / sizeof(int)


Or simply

sizeof arr / sizeof arr[0]


*Reference:*
http://msdn.microsoft.com/en-us/library/4s7x1k91(v=VS.100).aspx
http://en.wikipedia.org/wiki/Sizeof

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to