Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cours_prog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yassin.elhakoun
cours_prog
Commits
28e2a551
Verified
Commit
28e2a551
authored
2 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
fin rappel
parent
c3daf8d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/pointeurs_rappel.md
+18
-1
18 additions, 1 deletion
slides/pointeurs_rappel.md
with
18 additions
and
1 deletion
slides/pointeurs_rappel.md
+
18
−
1
View file @
28e2a551
...
...
@@ -126,4 +126,21 @@ int main() {
. . .
*
Un code buggé (99.9% du temps)
**et**
une fuite mémoire...
*
Mais avec un peu de chance le code va marcher (comportement indéfini).
\ No newline at end of file
*
Mais avec un peu de chance le code va marcher (comportement indéfini).
# Last but not least
## Les pointeurs et les tableaux
*
On peut allouer un tableau et le manipuler avec les pointeurs:
```
C
float *tab = malloc(12 * sizeof(*tab));
*tab = 1.2; // première case de tab = 1.2
tab[0] = 2.3; // première case de tab = 2.3
tab[2] = 3.4; // 3e case de tab = 3.4
*(tab + 4) = 4.5; // 4e case de tab = 4.5
// ceci était de l'arithmétique de pointeur
// on déréférence l'adresse (tab + 4)
// en unités de float
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment