本文共 2533 字,大约阅读时间需要 8 分钟。
char
, int
, short
, long
or long long
.unsigned char
, unsigned int
, unsigned short
, unsigned long
or unsigned long long
.float
and double
.char
can range(范围) only from -128 to 127, whereas a long
can range from -2,147,483,648 to 2,147,483,647 (long
and other numeric data types(数字数据类型) may have another range on different computers, for example - from –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 on 64-bit computer).#define BOOL char#define FALSE 0#define TRUE 1
int
, which an integer in the size of a "word"(字)the default number size of the machine which your program is compiled on. On most computers today, it is a 32-bit number, which means the number can range from -2,147,483,648 to 2,147,483,647.foo
and bar
, we need to use the following syntax(语法):int foo;int bar = 1;
foo
can be used, but since we did not initialize(初始化) it, we don't know what's in it. The variable bar
contains(包含) the number 1.a
, b
, c
, d
, and e
are variables, we can simply use plus, minus and multiplication(乘法) operators in the following notation, and assign(分配,赋值) a new value to a
:int a = 0, b = 1, c = 2, d = 3, e = 4;a = b - c + d * e;printf("%d", a); /* will print 1-2+3*4 = 11 */
a
, b
, and c
.#includeint main() { int a = 3; float b = 4.5; double c = 5.25; float sum; /* Your code goes here */ printf("The sum of a, b, and c is %f.", sum); return 0;}
#includeint main() { int a = 3; float b = 4.5; double c = 5.25; float sum; /* Your code goes here */ sum = a + b + c ; printf("The sum of a, b, and c is %f.", sum); return 0;}
转载地址:http://fnii.baihongyu.com/