Is it illegal to take address of main() function?

后端 未结 3 1070
Happy的楠姐
Happy的楠姐 2021-01-18 04:53

According to this answer using function main() is illegal (§3.6.1.3) and a function is used if its name appears in a potentially evaluated expression (§3.2

3条回答
  •  温柔的废话
    2021-01-18 05:21

    Since main is not "used" (you're not evaluating it) then it should be legal according the link you supplied.

提交回复
热议问题