C

History

C was first described in 1978 by Kernighan and Ritchie in the book "The C Programming Language" (Kernighan and Ritchie 1988). It is now defined by revisions of the ISO/IEC 9899 standard (ISO/IEC 2024) and other technical specifications. The C standards committee is the steward of the C programming language, working with the broader community to maintain and evolve the C language

Basics

Portability

Five kinds of portability issues are enumerated in Annex J of the C standard documents:

• Implementation-defined behavior • Unspecified behavior • Undefined behavior • Locale-specific behavior • Common extensions

(Seacord 2024, 9 chapter.1)

Data Types

Data Type Signed/Unsigned Bit Length Minimum Value Maximum Value
char Signed 8 bits -128 127
unsigned char Unsigned 8 bits 0 255
short Signed 16 bits -32,768 32,767
unsigned short Unsigned 16 bits 0 65,535
int Signed 16 or 32 bits -2,147,483,648 (32-bit) 2,147,483,647 (32-bit)
unsigned int Unsigned 16 or 32 bits 0 4,294,967,295 (32-bit)
long Signed 32 bits -2,147,483,648 2,147,483,647
unsigned long Unsigned 32 bits 0 4,294,967,295
long long Signed 64 bits -9,223,372,036,854,775,808 9,223,372,036,854,775,807
unsigned long long Unsigned 64 bits 0 18,446,744,073,709,551,615
float N/A 32 bits ~ -3.4 x 1038 ~ 3.4 x 1038
double N/A 64 bits ~ -1.7 x 10308 ~ 1.7 x 10308

References:

Kernighan, Brian W, and Dennis M Ritchie. 1988. The c Programming Language. prentice-Hall.
Seacord, Robert C. 2024. Effective c: An Introduction to Professional c Programming. No Starch Press, Inc.