vault backup: 2024-09-04 15:18:36
This commit is contained in:
parent
3c07ffefe2
commit
4f5b950e2f
@ -5,7 +5,6 @@ Commands for the preprocessor are called directives. Directives begin with a pou
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
```c
|
```c
|
||||||
//
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
```
|
```
|
||||||
2. Compiling. A compiler translates then translates the program into machine instructions.
|
2. Compiling. A compiler translates then translates the program into machine instructions.
|
||||||
@ -25,3 +24,10 @@ An integer is a way to store a whole number. In C, integers are signed by defaul
|
|||||||
A float is a decimal value. Slower arithmetic and inexact values are both drawbacks of using floats.
|
A float is a decimal value. Slower arithmetic and inexact values are both drawbacks of using floats.
|
||||||
## Variables
|
## Variables
|
||||||
A variable must be declared before it is assigned.
|
A variable must be declared before it is assigned.
|
||||||
|
|
||||||
|
|
||||||
|
# Formatting specifiers
|
||||||
|
| Specifier | Function |
|
||||||
|
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `%d` | Display an integer |
|
||||||
|
| `%f` | Display a float. Specify the number of places to round to by adding a decimal and a number, eg `%.2f` would round to two decimal places. |
|
Loading…
Reference in New Issue
Block a user