K

@kevshouse

ft_putstr.c

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

neg_to_pos.c

C
1 year ago
#include <stdio.h> int main() { int nb = -10;// a negative value. nb = -nb; // negative to positive conversion. printf("Hello world! %d:\n", nb); return 0; }

ft_strlen.c

C
1 year ago
#include <unistd.h> void ft_putchar(char c) { write (1, &c, 1); } void ft_putnbr(int nb) { if (nb < 0) { ft_putchar('-'); nb = -nb;

ft_putnbr.c

C
1 year ago
#include <stdio.h> #include <unistd.h> void ft_putchar(char c) { write(1, &c, 1); } void ft_putnbr(int nb) { /* Special base case for negatives, O/P a neg sign via ft_putchar();*/ if (nb < 0) {

ft_put_str.c

C
1 year ago
#include <unistd.h> void ft_putchar(char c) { write (1, &c, 1); } void ft_put_str(char *str) { int i;

digi_slice.c

C
1 year ago
#include <unistd.h> #include <stdio.h> int digi_slice(int n) { int accu; int digit; accu = n -( n%10 ); digit = n - accu;

write_basics.c

C
1 year ago
#include <unistd.h> void ft_swap( int *a, int *b) { a = b + a; b = b - a; a = a - b; } int main() {

ints_n_char.c

C
1 year ago
#include <stdio.h> #include <stdio.h> // Include the standard IO library for printf int main() { int my_int; char my_char[1]; int size_my_int; int size_my_char; my_int = 42;

ft_atoi.c

C
1 year ago
#include <stdio.h> #include <stdlib.h> #include <unistd.h> // the atoi of the exam is equal of the original, it isn't equal to the atoi of C04/ex03 // deliver only this function int ft_atoi(char *str) { int sum; int i;

binAllInt_int_to_bin_writer.c

C
1 year ago
#include <unistd.h> void int_to_binary_string(int num, char *bin_str) { int i = 7; while (num > 0) { bin_str[i--] = (num & 1) + '0'; num >>= 1; } bin_str[8] = '\0'; // Null terminator }

char_numerical_string.c

C
1 year ago
#include <stdio.h> #include <unistd.h> int main() { char num_char[1]; num_char[0] = ' '; // Starting character (ASCII 32) while(num_char[0] < 256) { write(1, &num_char[0], 1); num_char[0]++;

ft_ultimate_ft function.c

C
1 year ago
#include <unistd.h> void ft_putchar(char c) { write(1, &c, 1); } void ft_ultimate_ft(int *********nbr) { *********nbr = 42; }

ft_print_alphabet.c

C
1 year ago
#include <unistd.h> void ft_print_alphabet(void) { int i; i = 97; while (i < 123) { write(1, &i, 1);

pointy_pointer_pointNerf

C
1 year ago
#include <stdio.h> int main() { int num = 42; // Declare and initialize an integer variable int *ptr = &num; // Declare a pointer to an integer and assign the address of 'num' to it int **ptr_to_ptr = &ptr; // Declare a pointer to a pointer to an integer and assign the address of 'ptr' to it // You can access the value using double indirection

ft_ft.c

C
1 year ago
#include <unistd.h> void ft_ft(int *nbr) { *nbr = 42; } int main(void) { int catch_val;

ft_print_comb.c

C
1 year ago
#include <unistd.h> /* now you are getting familliar with the syntax so try to understand it alone ;) */ void ft_putchar(char c) { write(1, &c, 1); } /* void print_combination(char a, char b, char c) : Accepts three characters representing digits (a, b, c) and prints them as a combination. Converts each character to its corresponding digit by adding '0' to the character and then printing it using ft_putchar.

ft_putnbr.c

C
1 year ago
#include <unistd.h> void ft_putnbr(int nb) { long nbl; // long int char c[10]; short i; nbl = nb; // Paste our input (nb) into our long int, nbl.

broken-to-stringfunc

C
1 year ago
#include <unistd.h> void int_to_str(int num, char *buffer, size_t buf_size) { char digits[12]; // Max number of digits for a 32-bit int is 10, plus sign and null terminator char *ptr = digits + sizeof(digits) - 1; if (num < 0) { *(ptr--) = '-'; num = -num; }

stringythingy.c

C
1 year ago
#include <unistd.h> int my_strlen(const char *str) { int len = 0; while (str[len] != '\0') { len++; } return len; } void my_strcpy(char *dest, const char *src) {

Err_stairs.c

C
1 year ago
#include <unistd.h> int main() { int ascii_values[] = { 72, // 'H' 10, // '\n' 101, // 'e' 10, // '\n' 32, 108, // 'l' (preceded by a space) 10, // '\n'