1 / 6

Things to Remember in C++

Things to Remember in C++. CSC 331. Note:. A character in C++ can be interpreted as a small integer (between 0 and 255). For this reason, C++ often treats a character like an integer. Note:.

vlad
Download Presentation

Things to Remember in C++

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Things to Remember in C++ CSC 331

  2. Note: A character in C++ can be interpreted as a small integer (between 0 and 255). For this reason, C++ often treats a character like an integer.

  3. Note: In C++ the Boolean constants are true and false. Additionally, following traditional standards, any nonzero number is considered true, and zero is considered false.

  4. Note: When a variable is defined, it is not initialized. The programmer must initialize any variable requiring prescribed data when the function starts.

  5. Java initialization • Default initial values. • Integer: 0 • Floating point: 0.0 • Char: \u0000. • Boolean: false • Reference: null • Note: Unlike C++ these values will be given to all variables that are members of a class; however, local variables within a method that aren’t initialized will cause a compile-time error (unlike C++).

  6. Note: In C++ If a value is zero, it can be used as the logical value false. If a value is not zero, it can be used as the logical value true. Zero <===> False Nonzero <===> True

More Related