Jump to content

Recommended Posts

  • Bot

Hello, I have a doubt. I saw several codes in which the cases of the switch statement have keys {}.
So my question is: When do I know that keys should be put or not?
For example, in "if statement" must be set keys if the content of the "if" has more than one line.
Does the same thing happen with the cases?
Excuse my bad English.

english_banner.gif

  • Bot

No need for { }. Case actually tell the program where to start code execution and is executed until the end of the switch or break;

If you make a new case and place all the code you want inside { } and in the end you don't write break, the code will be executed after { } even if it is another case.

  • Love 1

english_banner.gif

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.