We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When doing the difference of two pointers the result should be divided by the sizeof the pointer type. E.g:
typedef struct s { int i; char c; } structs; structs arr2[30]; structs *left_ptr2 = &arr2[0]; structs *right_ptr2 = &arr2[20]; is_eq(right_ptr2 - left_ptr2, 20);
is correct in C, but gives 160 in Go.
The text was updated successfully, but these errors were encountered:
Adjust pointer diff for base size. Fixes elliotchance#706
634cb51
Pointer difference adjusts for base size. Fixes #706 (#707)
ad3e7a5
No branches or pull requests
When doing the difference of two pointers the result should be divided by the sizeof the pointer type.
E.g:
is correct in C, but gives 160 in Go.
The text was updated successfully, but these errors were encountered: