课程: Complete Guide to C++ Programming Foundations
免费学习该课程!
今天就开通帐号,24,100 门业界名师课程任您挑!
Variables
- [Instructor] There are a handful of important aspects about variables in C++. First and foremost, variables are temporary data storage units. They must be declared prior to being used. The declaration of a variable must specify a type and name. And declarations may contain initializations. In your code, you'll need to assign values to your variables. So let me briefly show you the syntax for representing values in some of the most popular types. Integer are entered as numbers with a special format for their ratings. The default is decimal, like 123, or minus five. A leading zero means octal, like 023. So be careful with this. For hexadecimal, start with 0x, like 0x3a. And for binary, start with 0b, as in 0b1100. You may specify unsigned with a trailing upper or lowercase U, as in 23U. Floats are entered with the decimal point and at least one digit to the right, even if the value happens to be an integer. And you must specify the float type with a trailing f, as in 23.0f, or 0.0f…
内容
-
-
-
-
Basic data types2 分钟 10 秒
-
(已锁定)
Integer types2 分钟 46 秒
-
(已锁定)
Floating point types1 分钟 29 秒
-
(已锁定)
Variables2 分钟 31 秒
-
(已锁定)
Using variables5 分钟 20 秒
-
(已锁定)
Type aliases3 分钟 58 秒
-
(已锁定)
Enumerations8 分钟 52 秒
-
(已锁定)
Structures3 分钟 13 秒
-
(已锁定)
Type casting6 分钟 18 秒
-
(已锁定)
Type casting examples7 分钟 2 秒
-
(已锁定)
Type inference with auto4 分钟
-
(已锁定)
Solution: Data types1 分钟
-
-
-
-
-
-
-
-
-