C

@cstuny

C07 Exercise 00 : ft_strdup uniquement test de la focntion man STRDUP

C
1 year ago
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { char str1[] = "Allez Alinghi!"; char *str2 = strdup(str1);

C06 Exercice 03 ft_sort_params.c

C
1 year ago
#include <unistd.h> void ft_swap_sp(char **a, char **b) // sp car adapte avec double ** // ici char ** car pt sur str (chaines) { // faire swap 2** car fonction prend adresse du pointeur! char *var_temp; // attention char pas int!! pas oublier * av var_temp var_temp = *a; *a = *b; *b = var_temp;

C05 Exercice 05 : ft_sqrt version recursif

C
1 year ago
#include <stdio.h> int ft_sqrt_recursive(int nb, long i) { if (i * i > nb) return (0); if (i * i == nb) return (i); return ft_sqrt_recursive(nb, i + 1); }

C05 Exercice 05 : ft_sqrt version GIT

C
1 year ago
#include <stdio.h> int ft_sqrt(int nb) { long i; i = 0; if (nb > 0) {

OCR sizeof

C
1 year ago
#include <stdio.h> int main() { printf("char : %d octets\n", sizeof(char)); printf("int : %d octets\n", sizeof(int)); printf("long : %d octets\n", sizeof(long)); printf("double : %d octets\n", sizeof(double)); return 0; }

C00 Exercice 07 : ft_putnbr tout les version de putnb

C
1 year ago
// version la plus simple #include <unistd.h> #include <limits.h> void ft_putnbr(int nb) { char z; if (nb == INT_MIN) {

C00 Exercice 07 : ft_putnbr

C
1 year ago
#include <unistd.h> void ft_putnbr(int nb) { char z; if (nb == -2147483648) { write(1, "-2147483648", 11); }

C00 Exercice 06 : ft_print_comb2

C
1 year ago
#include <unistd.h> void ft_print_comb2(void) { char comb2[5]; int a ; int b ; a = 0; while (a <= 98)

C00 Exercice 05 : void ft_print_comb(void)

C
1 year ago
#include <unistd.h> void ft_print_comb(void) { int a; int b; int c; a = '0'; while (a <= '7')

C00 Exercise 04 : ft_is_negative

C
1 year ago
#include <unistd.h> void ft_is_negative(int n) { if (n < 0) write(1, "N", 1); else write(1, "P", 1); }

C00 Exercice 03 : ft_print_numbers

C
1 year ago
#include <unistd.h> void ft_print_numbers(void) { char z; z = '0'; while (z <= '9') { write (1, &z, 1);

C00 Exercice 02 :ft_print_reverse_alphabet

C
1 year ago
#include <unistd.h> void ft_print_reverse_alphabet(void) { char c; c = 'z'; while (c >= 'a') { write (1, &c, 1);

C00 Exercice 01 : ft_print_alphabet

C
1 year ago
#include <unistd.h> void ft_print_alphabet(void) { char c; c = 'a'; while (c <= 'z' ) { write (1, &c, 1);

C00 Exercice 00 : ft_putchar

C
1 year ago
#include <unistd.h> void ft_putchar(char c) { write (1, &c, 1); } #include <stdio.h>

Examen level 2 Atoi ma version pour tester

C
1 year ago
#include <stdio.h> #include <stdlib.h> //int atoi(const char *str); int ft_atoi(char *s) { int sign; long r;

C04 Ex05 ft_atoi_base version git

C
1 year ago
#include <unistd.h> #include <stdio.h> int check_char(char *str) { if (*str == 32 || (*str >= 9 && *str <= 13)) return (1); else if (*str == '-' || *str == '+') return (2); else if (*str >= '0' && *str <= '9')

Examen Level 2 atoi version examen

C
1 year ago
#include <stdio.h> // int ft_atoi(char *s) { int sign; long r; r = 0; sign = 1; while (*s == 32 || (*s >= 9 && *s <= 13))

C03 comment tester fonction de la librairie avec man et comparer valeur

C
1 year ago
#include <stdio.h> #include <string.h> //int strcmp(const char *s1, const char *s2); int ft_strcmp(char *s1, char *s2) { int i; i = 0; while (s1[i] && s2[i] && (s1[i] == s2[i])) i++;

C03 comment tester fonction de la librairie avec man

C
1 year ago
#include <stdio.h> #include <string.h> //int strcmp(const char *s1, const char *s2); int ft_strcmp(char *s1, char *s2) { int i; i = 0; while (s1[i] && s2[i] && (s1[i] == s2[i])) i++;

C03 comment tester fonction de la librairie avec man et comparer valeur

C
1 year ago
#include <stdio.h> #include <stdlib.h> int strcmp(const char *s1, const char *s2); int ft_strcmp(char *s1, char *s2) { int i; i = 0; while (s1[i] && s2[i] && (s1[i] == s2[i])) i++;