Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //not by me
- //https://gcc.gnu.org/gcc-4.8/porting_to.html
- #include <string.h>
- struct A { };
- int main(void)
- {
- A obj;
- A* p1 = &obj;
- A p2[10];
- memset(p1, 0, sizeof(p1)); // error
- memset(p1, 0, sizeof(*p1)); // ok, dereferenced
- memset(p2, 0, sizeof(p2)); // ok, array
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement