Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp3
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
Model registry
Operate
Environments
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
adlenoir
tp3
Commits
56d92122
Commit
56d92122
authored
May 29, 2019
by
Skyx
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes
parent
b365f21a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.vscode/launch.json
+29
-0
29 additions, 0 deletions
.vscode/launch.json
src/dico.txt
+1
-0
1 addition, 0 deletions
src/dico.txt
src/fonctions.c
+9
-10
9 additions, 10 deletions
src/fonctions.c
with
39 additions
and
10 deletions
.vscode/launch.json
0 → 100644
+
29
−
0
View file @
56d92122
{
//
Use
IntelliSense
to
learn
about
possible
attributes.
//
Hover
to
view
descriptions
of
existing
attributes.
//
For
more
information
,
visit:
https://go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"name"
:
"(gdb) Launch"
,
"type"
:
"cppdbg"
,
"request"
:
"launch"
,
"program"
:
"${workspaceFolder}/app"
,
"args"
:
[],
"stopAtEntry"
:
false
,
"cwd"
:
"${workspaceFolder}"
,
"environment"
:
[],
"externalConsole"
:
true
,
"MIMode"
:
"gdb"
,
"setupCommands"
:
[
{
"description"
:
"Enable pretty-printing for gdb"
,
"text"
:
"-enable-pretty-printing"
,
"ignoreFailures"
:
true
}
]
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/dico.txt
+
1
−
0
View file @
56d92122
7
Tes
Tes
Test
Test
Roro
Roro
...
...
This diff is collapsed.
Click to expand it.
src/fonctions.c
+
9
−
10
View file @
56d92122
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
char
**
Chargement
(
int
*
error
,
int
*
nbMots
,
char
*
nomFichier
)
char
**
Chargement
(
int
*
error
,
int
*
nbMots
,
char
*
nomFichier
)
{
{
FILE
*
f
;
FILE
*
f
;
int
i
=
0
,
nbChar
;
int
i
,
nbChar
;
char
**
mots
=
NULL
;
char
**
mots
=
NULL
;
f
=
fopen
(
nomFichier
,
"r"
);
f
=
fopen
(
nomFichier
,
"r"
);
...
@@ -25,15 +25,16 @@ char ** Chargement(int *error, int *nbMots, char *nomFichier)
...
@@ -25,15 +25,16 @@ char ** Chargement(int *error, int *nbMots, char *nomFichier)
}
}
else
else
{
{
while
(
!
feof
(
f
))
fscanf
(
f
,
"%d
\n
"
,
nbMots
);
{
mots
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
*
nbMots
));
mots
=
(
char
**
)
realloc
(
mots
,
(
i
+
1
)
*
sizeof
(
char
*
));
if
(
!
mots
)
if
(
!
mots
)
{
{
fprintf
(
stderr
,
"Problème d'allocation !
\n
"
);
fprintf
(
stderr
,
"Problème d'allocation !
\n
"
);
*
error
=
EXIT_FAILURE
;
*
error
=
EXIT_FAILURE
;
}
}
else
{
else
{
for
(
i
=
0
;
i
<*
nbMots
;
++
i
)
{
mots
[
i
]
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
30
);
mots
[
i
]
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
30
);
if
(
!
mots
[
i
])
if
(
!
mots
[
i
])
{
{
...
@@ -45,12 +46,10 @@ char ** Chargement(int *error, int *nbMots, char *nomFichier)
...
@@ -45,12 +46,10 @@ char ** Chargement(int *error, int *nbMots, char *nomFichier)
nbChar
=
strlen
(
mots
[
i
]);
nbChar
=
strlen
(
mots
[
i
]);
if
(
mots
[
i
][
nbChar
-
1
]
==
'\n'
)
if
(
mots
[
i
][
nbChar
-
1
]
==
'\n'
)
mots
[
i
][
nbChar
-
1
]
=
'\0'
;
mots
[
i
][
nbChar
-
1
]
=
'\0'
;
++
i
;
}
}
}
}
}
}
fclose
(
f
);
fclose
(
f
);
*
nbMots
=
i
;
}
}
return
mots
;
return
mots
;
...
...
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