Skip to content
Snippets Groups Projects
Commit ed25b40b authored by mathias.catala's avatar mathias.catala
Browse files

" commit"

parent 037486ec
Branches
No related tags found
No related merge requests found
......@@ -87,11 +87,7 @@ void dir_print(directory_t *dir,int n){
person_t t = dir->content[n];
printf("[%d] ",n);
person_print(t);
}
}
......
myTP/TP13/exo1 100644 → 100755
No preview for this file type
......@@ -9,24 +9,22 @@ void reverse(char [], int, int);
int count(char* str, char c);
int main()
{
char str1[20]= "salut";
int size;
char test_char = 'a';
char* str = "Salut les amis";
char* str = "Salut les amis\n";
size = strlen(str1);
reverse(str1, 0, size - 1);
printf(" le nombre de charactère: '%c' dans %s est : %d",test_char,str,count(str,test_char));
//reverse(str1, 0, size - 1);
printf("\n");
reverse_print(str);
printf("Number: %d\n",count(str,'a'));
printf("The string after reversing is: %s\n", str1);
return 0;
}
void reverse_print(char* str){
if(*str){
reverse_print(str+1);
......@@ -40,18 +38,6 @@ int count(char* str, char c){
return count(str+1,c)+(*str==c);
}
return 0;
}
\ No newline at end of file
void reverse(char str1[], int index, int size)
{
char temp;
temp = str1[index];
str1[index] = str1[size - index];
str1[size - index] = temp;
if (index == size / 2)
{
return;
}
reverse(str1, index + 1, size);
}
\ No newline at end of file
#include <stdio.h>
#include <string.h>
typedef enum{WALL, PATH, START, END} maze_part_t;
typedef struct{
maze_part_t** data;
int n;
}maze_t;
// Affiche un labyrinthe dans le console
void maze_print(maze_t maze);
// Cette fonction alloue la mémoire pour un labyrinthe
// Initialise toutes les cases à WALL
maze_t maze_alloc(int n);
// Libère la mémoire d'un labyrinthe
// met maze.data à NULL
void maze_free(maze_t maze);
void maze_create(maze_t maze);
int main(){
maze_print(maze_t maze)
}
void maze_print(maze_t maze){
int size = maze.n;
printf("size : %d", maze.data);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment