LCTHW: DATA TYPE

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

char: character data type

sizeof gives the size in units of chars. These "C bytes" need not be 8-bit bytes (though commonly they are); Any encoding of 8 bits or less (e.g. ASCII) can be used to store characters. Integer operations can be performed portably only for the range 0 ~ 127. All bits contribute to the value of the char, i.e. there are no "holes" or "padding" bits

User Defined Types typedef

typedef has syntax similar to a storage class like static, register or extern.

long double

unsigned cannot be specified.

User Defined Types union

Said to be an aggregate type.

Primitive Types added to ISO C (C99) intmax_t

Can store integers in the range -(1 << n-1)+1 ~ (1 << n-1)-1, with 'n' the width of intmax_t. Used by the "j" length modifier in the C Programming/File IO#Formatted output functions: the printf family of functions.

long: alternative name: long int, signed long, signed long int

Can store integers in the range -2147483647 ~ 2147483647 portably

short: alternate name: short int, signed short, signed short int

Can store integers in the range -32767 ~ 32767 portably. Used to reduce memory usage (although the resulting executable may be larger and probably slower as compared to using int.

Primitive Types added to ISO C (C99) long long alternative name: long long int, signed long long, signed long long int

Can store integers in the range -9223372036854775807 ~ 9223372036854775807 portably

Primitive Types added to ISO C (C99) uintmax_t

Can store integers in the range 0 ~ (1 << n)-1, with 'n' the width of uintmax_t.

Primitive Types added to ISO C (C99) unsigned long long alternative name: unsigned long long int

Can store integers in the range 0 ~ 18446744073709551615 portably.

unsigned long alternative name: unsigned long int

Can store integers in the range 0 ~ 4294967295 portably.

unsigned int: alternative name: unsigned

Can store integers in the range 0 ~ 65535 portably.

unsigned short: alternate name: unsigned short int

Can store integers in the range 0 ~ 65535 portably. Used to reduce memory usage (although the resulting executable may be larger and probably slower as compared to using int.

unsigned char

Characters stored like for type char. Can store integers in the range 0 ~ 255 portably.

signed char

Characters stored like for type char. Can store integers in the range -127 ~ 127 portably

User Defined Types enum

Enumerations are a separate type from ints, though they are mutually convertible.

int: alternative name: signed, signed int

Represents the "normal" size of data the processor deals with (the word-size); this is the integral data-type used normally. Can store integers in the range -32767 ~ 32767 portably

double

Represents the "normal" size of data the processor deals with; this is the floating-point data-type used normally. The floating-point format used is implementation defined and need not be the IEEE double-precision format. unsigned cannot be specified.

User Defined Types struct

Said to be an aggregate type.

float

Used to reduce memory usage when the values used do not vary widely. The floating-point format used is implementation defined and need not be the IEEE single-precision format. unsigned cannot be specified.


Kaugnay na mga set ng pag-aaral

ch.7 food & nutrients quiz review

View Set

Section P.3 Radicals and Rational Exponents

View Set

PHYSICAL ANTH. LAB CHAPTERS 9 - 12 TEST

View Set

Chapter 13 - Marketing : Helping buyers Buy

View Set

4.1.10 Practice Questions - Device & User Management

View Set