STEP 3
The primary distinction between a character and a string is that a character is a single letter, number, space, punctuation mark, or symbol that may be represented on a computer, whereas a string is a collection of characters.
The char data type in the C programming language can be used to store both character values and string values. In addition, the ASCII and Extended ASCII standards specify the characters that can be represented by a digital representation in a computer.
Let us look at some example of Data Types their uses and examples in the table below:
Data Type | Used for | Example |
String | Alphanumeric characters | hello world, Alice, Bob123 |
Integer | Whole numbers | 7, 12, 999 |
Float (floating point) | Number with a decimal point | 3.15, 9.06, 00.13 |
Character | Encoding text numerically | 97 (in ASCII, 97 is a lower case 'a') |
Boolean | Representing logical values | TRUE, FALSE |
No comments:
Post a Comment