ITF+ Certification Cram Notes
1.0 IT Concepts and Terminology:
1.2 Compare and contrast fundamental data types and their characteristics
1. Char: A character data type represents a single character, such as a letter or a number. In most programming languages, a char is represented by a single byte of memory. This data type is commonly used for storing individual characters or small amounts of text.
2. Strings: A string data type represents a sequence of characters. Strings are usually represented as an array of characters or as an object in object-oriented programming languages. This data type is commonly used for storing text, such as names, addresses, or sentences.
3. Numbers: Numbers are a fundamental data type that can represent numeric values. There are two main types of numbers:
Integers: Integers are whole numbers, which means they do not have a fractional part. Integers can be represented in different sizes, such as 8-bit, 16-bit, or 32-bit, depending on the programming language.
Floats: Floats, or floating-point numbers, are used to represent numbers with a fractional part. Floats are usually represented in 32-bit or 64-bit format, and they can represent a wider range of numbers than integers.
4. Boolean: A boolean data type represents a logical value, such as true or false. Booleans are typically represented using a single bit of memory, and they are commonly used for making decisions in programming, such as in conditional statements or loops.
In comparison, char and string are used to represent text, but char is used for a single character, while string is used for a sequence of characters. Numbers are used to represent numeric values, and they can be integers or floats. Boolean is used to represent logical values, such as true or false.