|
|
# Organisation du Cours
|
|
|
[1242.1.00_Organisation_du_cours.pdf](uploads/dc74dc7d36b2fc1134a6dd706b0dde4f/1242.1.00_Organisation_du_cours.pdf)
|
|
|
|
|
|
# Installation de l'environnement de développement
|
|
|
[installer_le_C_sous_MSVSC_le_gcc_et_faire_un_helloworld_v20220829-00.pdf (par Prof. Gobron)](uploads/f8bbab5c2c3e72e6b3e19549bc88eed1/installer_le_C_sous_MSVSC_le_gcc_et_faire_un_helloworld_v20220829-00.pdf)
|
|
|
|
|
|
## En résumé
|
|
|
1. Installer **[Visual Studio Code](https://code.visualstudio.com/)**
|
|
|
2. Installer les **[extensions Visual Studio Code recommandées pour le C](https://stackoverflow.com/c/he-arc-ing/questions/39)**
|
|
|
3. Downloader et installer **[MSYS2 ](https://github.com/msys2/msys2-installer/releases/download/2022-06-03/msys2-x86_64-20220603.exe)**
|
|
|
4. Lancer MSYS2
|
|
|
|
|
|
**IL EST FORTEMENT RECOMMANDÉ DE COPIER-COLLER LES COMMANDES SUIVANTES**
|
|
|
|
|
|
**RÉPONDEZ yes / all / default QUAND C'EST DEMANDÉ**
|
|
|
|
|
|
5. Exécuter la commande suivante : **`pacman -Syu`**
|
|
|
6. Lancer MSYS2 de nouveau
|
|
|
7. Exécuter la commande suivante : **`pacman -Su`**
|
|
|
8. Exécuter la commande suivante : **`pacman -S --needed base-devel mingw-w64-x86_64-toolchain`**
|
|
|
9. Ajouter le chemin vers gcc dans les variables d'environnement (`C:\msys64\mingw64\bin` par défault).
|
|
|
10. Relancer Visual Studio Code, ouvrir un nouveau terminal exécuter **`gcc --version`**.
|
|
|
|
|
|
# Chapitre 1
|
|
|
## Cours
|
|
|
[1242.1.01_Introduction.pdf](uploads/41c86838769ee32348a544ba95e0666c/1242.1.01_Introduction.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap1.c](uploads/06cf530e5f58692e1834b63ad9debf3e/chap1.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1013880)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
[Données Exercices chapitre 1](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-1-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 1](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1872897)
|
|
|
|
|
|
# Chapitre 2
|
|
|
## Cours
|
|
|
[1242.1.02_Types_et_variables.pdf](uploads/7b350a0e2c1ed5c1ae165ac07f06354a/1242.1.02_Types_et_variables.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap2.c](uploads/86d68de2c99618044b4bf139a4a335d6/chap2.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1013887)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
[Données exercices chapitre 2, partie 1](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-2-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 2, partie 2](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-2-2-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 2](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1877290)
|
|
|
|
|
|
# Chapitre 3
|
|
|
## Cours
|
|
|
[1242.1.03_Opérateurs.pdf](uploads/5d2acc21f971fcebfa4573674b505536/1242.1.03_Opérateurs.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap3.c](uploads/109995bb970207eb5d8f6b4843881902/chap3.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn, partie 1](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1013903)
|
|
|
|
|
|
[Quiz Cyberlearn, partie 2](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1013905)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
[Données exercices chapitre 3](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-3-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
**Pas d'auto-évaluation pour cette série.**
|
|
|
|
|
|
# Chapitre 4
|
|
|
## Cours
|
|
|
[1242.1.04_Entrees-Sorties.pdf](uploads/395fe768eef79d5e9d0a496f6ffd7b77/1242.1.04_Entrees-Sorties.pdf)
|
|
|
### `Friendly scanf`
|
|
|
As per the C11 standard, using fflush(stdin) is undefined behavior. therefore, it should not be use.
|
|
|
|
|
|
> ### 7.21.5.2 The fflush function
|
|
|
>
|
|
|
> #### Description
|
|
|
> If stream points to an output stream or an update **stream in which the most recent
|
|
|
> operation was not input**, the fflush function causes any unwritten data for that stream
|
|
|
> to be delivered to the host environment to be written to the file; **otherwise, the behavior is
|
|
|
> undefined.**
|
|
|
|
|
|
```c
|
|
|
// Handling User input errors:
|
|
|
// 1) Print what is expected
|
|
|
// 2) Read input from User
|
|
|
// 3) Empty the stdin buffer
|
|
|
// 4) Repeat until we got what we expected
|
|
|
int status = 0;
|
|
|
const int nbExpectedValues = 1;
|
|
|
// Variables to store User input values
|
|
|
int x;
|
|
|
do
|
|
|
{
|
|
|
printf("Entrez un nombre : ");
|
|
|
status = scanf("%d", &x);
|
|
|
|
|
|
// IMPORTANT: fflush(stdin) does not always work!
|
|
|
// It is strongly advised NOT to use it
|
|
|
// fflush(stdin);
|
|
|
// Instead, empty the buffer "manually"
|
|
|
{
|
|
|
int c;
|
|
|
do
|
|
|
{
|
|
|
c = getchar();
|
|
|
} while (c != '\n' && c != EOF);
|
|
|
}
|
|
|
|
|
|
// BIIIP to let user know when there is a problem
|
|
|
if (status != nbExpectedValues)
|
|
|
{
|
|
|
printf("\a");
|
|
|
}
|
|
|
} while (status != nbExpectedValues);
|
|
|
```
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap4.c](uploads/61305c73a14cdf6d9b38153f8deb75f9/chap4.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1019991)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
[Données exercices chapitre 4](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-4-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 4](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1894039)
|
|
|
|
|
|
# Chapitre 5
|
|
|
## Cours
|
|
|
[1242.1.05_Structures_de_contrôle.pdf](uploads/8de4fc34da4669e9607dc49e08608f47/1242.1.05_Structures_de_contrôle.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap5.c](uploads/81f2b0760a153752f28d91512ce9d429/chap5.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1020234)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
[Données exercices chapitre 5, partie 1](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-5-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 5, partie 2](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-5.2-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 5, partie 3](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-5.3-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 5, partie 4](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-5.4-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 5, partie 1](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1895258)
|
|
|
|
|
|
[Auto-évaluation chapitre 5, partie 2](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1895264)
|
|
|
|
|
|
[Auto-évaluation chapitre 5, partie 3](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1895267)
|
|
|
|
|
|
**Pas d'auto-évaluation pour la partie 4.**
|
|
|
|
|
|
# Chapitre 6
|
|
|
## Cours
|
|
|
[1242.1.06_Fonctions_I.pdf](uploads/e161babdfa47f1726837e4eb68ffe2d9/1242.1.06_Fonctions_I.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap6.c](uploads/356f94aaa7dac24d4c8d32809ecc8a80/chap6.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1025567)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
|
|
|
[Données exercices chapitre 6](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-6-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 6](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1899580)
|
|
|
|
|
|
# Chapitre 7
|
|
|
## Cours
|
|
|
[1242.1.07_Compilation.pdf](uploads/12110b0301624e3a30c91a3a5055abb7/1242.1.07_Compilation.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
**PAS DE SQUELETTE POUR CE CHAPITRE**
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1028471)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
[Données exercices chapitre 7](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-7-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
**PAS D'AUTO-ÉVALUATIONS POUR CE CHAPITRE**
|
|
|
|
|
|
# Chapitre 8
|
|
|
## Cours
|
|
|
[1242.1.08_TableauxStructures.pdf](uploads/d9870bed9ab2292bcce832c51c825d8e/1242.1.08_TableauxStructures.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap8.c](uploads/65178ef4d255c0d680f3331ca4eac8e3/chap8.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1028487)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
|
|
|
[Données exercices chapitre 8, partie 1](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-8.1-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 8, partie 2](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-8.2-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 8, partie 3](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-8.3-:-exercices)
|
|
|
|
|
|
[Données exercices chapitre 8, partie 4](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-8.4-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 8, partie 2](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1911026)
|
|
|
|
|
|
[Auto-évaluation chapitre 8, partie 4](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1911027)
|
|
|
|
|
|
# Chapitre 9
|
|
|
## Cours
|
|
|
[1242.1.09_Pointeurs.pdf](uploads/59d32f126199e710a78037cfe242e75c/1242.1.09_Pointeurs.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap9.c](uploads/b21e284f74b70876b94f631680954d33/chap9.c)
|
|
|
|
|
|
## Quiz
|
|
|
[Quiz Cyberlearn](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1056320)
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
|
|
|
[Données exercices chapitre 9](https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-9-:-exercices)
|
|
|
|
|
|
### Auto-évaluations
|
|
|
[Auto-évaluation chapitre 9](https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1919092)
|
|
|
|
|
|
# Chapitre 10
|
|
|
## Cours
|
|
|
[1242.1.10_AllocationDynamique.pdf](uploads/d59b9106416307090e289bad1e8a343a/1242.1.10_AllocationDynamique.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap10.c](uploads/f720425134e5b7112c5ddc58f20bf4bc/chap10.c)
|
|
|
|
|
|
## Quiz
|
|
|
https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1069106
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-10-:-exercices
|
|
|
|
|
|
### Auto-évaluations
|
|
|
**PAS D'AUTO-ÉVALUATIONS POUR CE CHAPITRE**
|
|
|
|
|
|
# Chapitre 11
|
|
|
## Cours
|
|
|
[1242.1.11_Fonctions_II.pdf](uploads/9d6169aec83812dfb2313f83ba484719/1242.1.11_Fonctions_II.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap11.c](uploads/5f992b175a9ec006f0d96a40828b6539/chap11.c)
|
|
|
|
|
|
## Quiz
|
|
|
https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1080225
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-11-:-exercices
|
|
|
|
|
|
### Auto-évaluations
|
|
|
https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1927172
|
|
|
|
|
|
# Chapitre 12
|
|
|
## Cours
|
|
|
[1242.1.12_StructuresEtType.pdf](uploads/e38b2fe9ee11d61b452349213b197fd1/1242.1.12_StructuresEtType.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
[chap12.c](uploads/d1efa4099c0f2712ad076eff5dd1e6df/chap12.c)
|
|
|
|
|
|
## Quiz
|
|
|
https://cyberlearn.hes-so.ch/mod/quiz/view.php?id=1085452
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-12-:-exercices
|
|
|
|
|
|
### Auto-évaluations
|
|
|
**PAS D'AUTO-ÉVALUATIONS POUR CE CHAPITRE**
|
|
|
|
|
|
# Chapitre 13
|
|
|
## Cours
|
|
|
[1242.1.13_Listes_chainées.pdf](uploads/2009a757f6c4ff5ed6c4b173a1370775/1242.1.13_Listes_chainées.pdf)
|
|
|
|
|
|
## Squelette à remplir
|
|
|
**Pas de squelette pour ce chapitre.**
|
|
|
|
|
|
## Quiz
|
|
|
**Pas de quiz pour ce chapitre.**
|
|
|
|
|
|
## Exercices
|
|
|
### Données
|
|
|
https://gitlab-etu.ing.he-arc.ch/isc/2022-23/niveau-1/1242.1-langage_c/-/wikis/Chapitre-13-:-exercices
|
|
|
|
|
|
### Auto-évaluations
|
|
|
**PAS D'AUTO-ÉVALUATIONS POUR CE CHAPITRE** |
|
|
\ No newline at end of file |