Why does declaring main as an array compile?

前端 未结 6 1936
一整个雨季
一整个雨季 2021-01-31 07:35

I saw a snippet of code on CodeGolf that\'s intended as a compiler bomb, where main is declared as a huge array. I tried the following (non-bomb) version:



        
6条回答
  •  深忆病人
    2021-01-31 07:42

    const int main[1] = { 0xc3c3c3c3 };
    

    This compiles and executes on x86_64... does nothing just return :D

提交回复
热议问题