c - How does the main function actually behave when written as main||integer -


i have tested program on gcc it's answer 1. not find reason how?

main() { int c = 5; printf("%d", main||c); } 

answer:it showing on gcc compilers (dev c++)

this logical or operation. evaluates 1 if @ least 1 of main not null pointer or c nonzero; otherwise, yields 0. since main() existing function, pointer not null, , 5 not zero, code print 1.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -