Compare commits

...

No commits in common. "9de1751f71f7294adb04f1f8fa0090771736c157" and "96d240ad58a5b01f219fe87cb6179b1192b832a5" have entirely different histories.

4 changed files with 5 additions and 58 deletions

0
C/him.md Normal file
View file

View file

@ -1,8 +1,6 @@
# Rappels de langage C
# Pointeurs
```
## Pointeurs
```
struct S {
int x;
int y
@ -24,58 +22,11 @@ charch[]="OULA" // Ici on déclare la constante OULA en tant que variable locale
// Ici char* ch ="OULA" correspond à une adresse. A EVITER.
```
**Si on tente de modifier une variable dans une zone ReadOnly, on a erreur à l'exécution**
**Si on tente de modifier une variable dans une zone ReadOnly, on a erreur à l'exécution**
<p align="center">
<img src="./Rappels/Images/binary_build.png">
<img src="./Rappels/Images/binary_build.png)">
</p>
# Passages d'arguments
Pour une fonction, si on souhaite modifier la valeur d'une variable en la passant en argument d'une fonction, il est impératif de passer l'adresse de la variable en argument et non pas sa valeur.
```
void fonction(int i){ i++;}
int j=5;
fonction(j);
printf("%d",j); // OUTPUT : 5;
//SI ON REMPLACE LA FONCTION DE CETTE FACON
void fonction(int* i){ i++;}
fonction(&j);
printf("%d",j); // OUTPUT : 6;
```
# printf
```
%d // int
%f // float
%c // char
%s // chaine de charactères
int i;
char ch;
char* str;
printf("%d, %c, %s", i , ch , str);
```
# Structures
##
```
struct s {
int e;
char ch[4];
} tab;
// Ici le type est struct s et on crée une variable tab de type struct s
typedef struct {
int e;
char ch[4];
}tab;
// Ici le type est tab et on ne crée en aucun cas une variable.
```

View file

@ -1,4 +0,0 @@
# Introduction à la Cryptographie
Responsable : vincent.migliore@insa-toulouse.fr
# Definitions