SubhanUllah Posted October 13, 2022 Report Share Posted October 13, 2022 Check the block, in which the variable is declared. When the block ends, the scope ends, and the variable is not valid any more. Example: if (1) { int a; // scope starts if (1) { } // scope ends } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.