Week 3

Created by Miroslav Biňas / mirek

## Basic Data Types
## Structure Data Types
```cpp struct person { char name[10]; char surname[20]; char sex; // M, F int age; }; ```
## `typedef`
## `typedef` Usage ```cpp // new type typedef unsigned char BYTE; // variable declaration BYTE byte; // is equivalent for unsigned char byte; ```

size_t

Unsigned integer type of the result of the sizeof operator.
## Size of Structured Type
```cpp struct person { char name[10]; // 10 char surname[20]; // 20 char sex; // 1 size_t age; // 8 }; ```
## Structure Initialization ```cpp // standard way struct person sherlock = { "sherlock", "holmes", 'M', 33 }; // designated initialiser (C99) struct person john = { .sex = 'M' .age = 42 .surname = "smith", .name = "john", }; ```
## Data Persistence
``` John Black M Josephine Scarlet F Michael Mustard M Blanche White F ```

CSV

Comma Separated Values
John;Black;M
Josephine;Scarlet;F
Michael;Mustard;M
Blanche;White;F
John;Green;M
Patricia;Peacock;F
Peter;Plum;M
Amelia;Peach;F
Alfred;Gray;M
Philippe;Azure;M
## Binary File > a file, that is not a text file ([wikipedia](https://en.wikipedia.org/wiki/Binary_file))
size_t fread(void *ptr,
     size_t size,
     size_t nmemb,
     FILE *stream);
size_t fwrite(const void *ptr,
      size_t size,
      size_t nmemb,
      FILE *stream);
## Serialization
## Deserialization
## Questions?