Embedded C

Embedded C . 1. C Language 1.1. Introduction Programming language is a set of instructions that used to communicate with a computer and control its behavior. C is a general-purpose procedural programming language. 1.2. Expression An expression is a combination of operators, constants and variables that evaluate to a value. There are several types of expressions, including: constant expr: 5, 10+3 integral expr: x*y floating expr: x + 10.75 relational expr: x <=y logical expr: x > y && z == 6 pointer expr: &x bitwise: x<<3 1.3. Variables & Data Types A variable is a named location in memory that stores data. Every variable must be declared to specify its type. e.g. int a; Common Data Types in C: Data Type Size (Typical) Range char 1 byte -128 to 127 unsigned char 1 byte 0 to 255 short 2 bytes -32,768 to 32,767 int (16-bit) 2 bytes -32,768 to 32,767 int (32-bit) 4 bytes -32,768 to 32,767 unsigned int 2 bytes 0 to 65,535 (16-bit) long 4 bytes -2,147,483,648 to 2,147,483,647 float 4 bytes ±3.4e±38 (~6–7 digits precision) double 8 bytes On a 32-bit machine, short is not efficient because the CPU is designed to process 32-bit data in one step. ...

March 21, 2026 · 5 min · Phong Nguyen