In reply to Yash_wanth12345:
It makes no difference if the declaration of ch is in the begin or fork blocks—initializations of automatic variables work the same. A fork block does not consider them as executable statements.
In reply to Yash_wanth12345:
It makes no difference if the declaration of ch is in the begin or fork blocks—initializations of automatic variables work the same. A fork block does not consider them as executable statements.