Original Post
Comments for the article String Usage and Architecture
Quote:
Original post by Wc-duck
Read this right now and needed to point out an error:
The author says "myarray[2] is really just shorthand for *(myarray+2)". That is not true myarray[2] is the same as *(myarray+sizeof(myarray_element_type)) and that is acctually a huge difference.
Quote:No it's not. The element size is implicit in both cases. The only time the element size matters is if you're dealing with raw bytes, such as for memcpy().
Original post by Wc-duck
The author says "myarray[2] is really just shorthand for *(myarray+2)". That is not true myarray[2] is the same as *(myarray+sizeof(myarray_element_type)) and that is acctually a huge difference.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more