Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prog-c
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stefan.nikolic
prog-c
Commits
a24b7800
Commit
a24b7800
authored
6 months ago
by
Nikolic
Browse files
Options
Downloads
Patches
Plain Diff
Ajout de la function pour convertir une lettre en répresention Morse
parent
00d6af06
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
24-25/TP14/arbinaire_morse.c
+16
-0
16 additions, 0 deletions
24-25/TP14/arbinaire_morse.c
24-25/TP14/arbinaire_morse.h
+12
-2
12 additions, 2 deletions
24-25/TP14/arbinaire_morse.h
with
28 additions
and
2 deletions
24-25/TP14/arbinaire_morse.c
+
16
−
0
View file @
a24b7800
...
@@ -71,3 +71,19 @@ char recherche(char * morse, tree tree){
...
@@ -71,3 +71,19 @@ char recherche(char * morse, tree tree){
}
}
return
tree
->
d
;
return
tree
->
d
;
}
}
void
destroyTable
(
int
nb
,
char
**
table
){
for
(
int
i
=
0
;
i
<
nb
;
i
++
)
{
free
(
table
[
i
]);
}
free
(
table
);
}
char
*
recherche_morse
(
char
letter
){
char
**
table
=
loadTableMorse
(
"morse.txt"
);
char
*
morse
=
malloc
(
5
*
sizeof
(
*
morse
));
morse
=
strcpy
(
morse
,
table
[
letter
-
65
]);
// permet de convertir une lettre en majuscule
destroyTable
(
26
,
table
);
// 26 = nombres totale de lettres
return
morse
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
24-25/TP14/arbinaire_morse.h
+
12
−
2
View file @
a24b7800
...
@@ -43,6 +43,16 @@ void parcours_infix(node * node, int n);
...
@@ -43,6 +43,16 @@ void parcours_infix(node * node, int n);
int
depth
(
node
*
node
,
int
nbmax
,
int
nb
);
int
depth
(
node
*
node
,
int
nbmax
,
int
nb
);
/*
/*
* Function
permettant de trouver à partir d'une séquance morse de quel characère il s'agit
* Function
qui prend la répresentation Morse en entrée et retourne la répresentation char.
*/
*/
char
recherche
(
char
*
morse
,
tree
tree
);
char
recherche
(
char
*
morse
,
tree
tree
);
/*
* Function permettant de détruire une table et de libérer sa mémoire
*/
void
destroyTable
(
int
nb
,
char
**
table
);
/*
* Function qui prend une lettre en entrée et retourne la représentation Morse correspondante.
*/
char
*
recherche_morse
(
char
letter
);
\ 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