What is the meaning of
*(int *)0 = 0;
It does compile successfully
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It will usually cause an access violation at runtime. The following is done: first 0 is cast to an
int *and that yields a null pointer. Then a value 0 is written to that address (null address) – that causes undefined behaviour, usually an access violation.Effectively it is this code: