课程: Complete Guide to C Programming Foundations
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Specifying integers and real numbers - C教程
课程: Complete Guide to C Programming Foundations
Specifying integers and real numbers
- [Instructor] Numbers in C come in two flavors. The INT data type stores integers, or whole number values, the float and double data types store real numbers, are those that contain a decimal portion or are very large or very small. Integer literals are written without commas as shown in line 5. For real numbers, always specify the decimal part. At line 6, float value, 0.25, is written as 0.25. At line 7, the real value 1 billion, no commas, has a trailing dot zero. This format, dot zero and zero dot inform the compiler that the literal value is a float or double number. This exercise file provides a quick test, run it. That'll type 100 million and it works. Now I'm going to run it again, but I'm going to type a comma. You see the value is truncated from what was input, not what you want. At line 10, the fgets function reads a string of characters into the buffer character array. The strtol function converts the string into a value stored in variable lv. This function doesn't…
内容
-
-
-
-
Understanding C language data types3 分钟 17 秒
-
(已锁定)
Declaring variables2 分钟 53 秒
-
(已锁定)
Working with variables3 分钟 4 秒
-
(已锁定)
Exploring the printf() function3 分钟 48 秒
-
(已锁定)
Using constants2 分钟 58 秒
-
Challenge: Making variables and constants53 秒
-
(已锁定)
Solution: Making variables and constants1 分钟 16 秒
-
(已锁定)
Understanding variable scope3 分钟 35 秒
-
(已锁定)
Making new data types3 分钟 25 秒
-
(已锁定)
Specifying characters and strings3 分钟 17 秒
-
(已锁定)
Specifying integers and real numbers3 分钟 55 秒
-
(已锁定)
Typecasting a variable2 分钟 20 秒
-
(已锁定)
Chapter challenge: Adding variables and constants1 分钟 10 秒
-
(已锁定)
Chapter solution: Adding variables and constants2 分钟 7 秒
-
-
-
-
-
-
-
-
-
-