Skip to content
Snippets Groups Projects
Commit 3cafb750 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added begining of strings. table not working yet

parent cf48dedd
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ HTMLOPTIONS += -t html5
HTMLOPTIONS += -c css/tufte-css/tufte.css
HTMLOPTIONS += --self-contained
all: tests_assertions.pdf make.pdf base_3.pdf base_2.pdf base_1.pdf intro.pdf index.html
all: strings.pdf tests_assertions.pdf make.pdf base_3.pdf base_2.pdf base_1.pdf intro.pdf index.html
intro.pdf: intro.md metadata.yaml
pandoc $(PDFOPTIONS) -o $@ $^
......@@ -39,6 +39,9 @@ make.pdf: make.md metadata.yaml
tests_assertions.pdf: tests_assertions.md metadata.yaml
pandoc $(PDFOPTIONS) -o $@ $^
strings.pdf: strings.md metadata.yaml
pandoc $(PDFOPTIONS) -o $@ $^
index.html: index.md
pandoc -s $(OPTIONS) $(HTMLOPTIONS) -o $@ $<
......
% Chaînes de caractères
% Inspirés des slides de F. Glück
% 16 octobre 2019
# Rappel: le type `char`{.C}
- Le type `char`{.C} est utilisé pour représenter un caractère.
- C'est un entier 8 bits signé.
- En particulier:
- Écrire
```C
char c = 'A';
```
- Est équivalent à:
```C
char c = 65;
```
- Les fonctions d'affichage interprètent le nombre comme sa valeur ASCII.
# Chaînes de caractères (strings)
- Chaîne de caractère `==` tableaude caractères **terminé par la valeur `'\0'`{.C} ou `0`{.C} **.
## Exemple
```C
char str = "HELLO !";
```
Est représenté par
`H` | `E` | `L` | `L` | `O` | ` ` | `!` | `\0` |
===============================================
`72` | `69` | `76` | `76` | `79` | `32` | `33` | `0` |
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment