Which new C features appeared recently, such as 0b for binary numbers and ranges for…
- User
Which new C features appeared recently, such as 0b for binary numbers and ranges for case statement?
- Assistant
There have been several new features introduced in recent versions of the C programming language. Some notable ones include:
-
Binary literals (0b prefix): This feature allows you to specify binary numbers directly in your code using the prefix "0b". For example, 0b101 represents the binary number 101.
-
Ranges in the case statement: Starting from the C11 standard, you can use ranges in the case statement. This allows you to specify a range of values and execute the corresponding code block if the value matches within that range. For example, case 1 ... 5 represents a range from 1 to 5 (inclusive).
-