Jump to content

Search the Community

Showing results for tags 'mistake'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello dear, i found one of your websites about the switch case statements in C++. https://www.w3schools.com/cpp/cpp_switch.asp It says: "If there is a match, the associated block of code is executed." This is not wrong, BUT it is not mentioned later (break statements), that the code ist executed *from the line* of the match (and not only the match codeblock) to the end of the switch block, if there is no break statement. "break" does not only save runtime, if you don't use it, you will get some hard to find unexpected behavior in your programs. Example: int i= 7; switch (i) { case 5: cout << 5 << endl; case 6: cout << 6 << endl; case 7: cout << 7 << endl; case 8: cout << 8 << endl; case 9: cout << 9 << endl; } Output: 7 8 9 Greets
×
×
  • Create New...