G

@genie

c04.ex05

C
2 years ago
#include <stdio.h> #include <unistd.h> int str_in_base(char *str, char *base, int len_base); int is_valid_base(char *base, int len_base); int str_to_int(char *str, char *base, int len_base); int digit_to_pos(char c, char *base); int ft_atoi_base(char *str, char *base) {

c01_07 draft by jinsoo

C
2 years ago
#include <unistd.h> void ft_swap(int *a, int *b) { int i; i = *a; *a = *b; *b = i; } void ft_rev_int_tab(int *tab, int size) {

24.03.14 segmentation fault

C
2 years ago
#include <stdio.h> int main(void) { char *a = "abc"; char *b = "123"; printf("%s, %s", a, b); int *ptr1;

24.03.13 string error

C
2 years ago
// #include <unistd.h> #include <string.h> // void ft_putstr(char *str) { int i; i = 0; while (str[i] != '\0')

24.03.13 assgning adr of a value in the func -> doesnt work in main

C
2 years ago
// #include <stdio.h> #include <stdlib.h> // void ft_div_mod(int a, int b, int *div, int *mod) { int i_div; int i_mod;

24.03.13. ptr to ptr basic2 (concept)

C
2 years ago
#include <stdio.h> // void ft_ultimate_ft(int *********nbr) { /* int ********nbr8; int *******nbr7; int ******nbr6; int *****nbr5; int ****nbr4;

24.03.13. ptr to ptr basic (concept)

C
2 years ago
#include <stdio.h> int main() { //legal (1) int a = 1; int **ptr2; int *ptr1; ptr2 = &ptr1; ptr1 = &a;

c00_ex00, ptrs: not working (concept)

C
2 years ago
#include <unistd.h> void ft_ft(int *nbr) { *nbr = 42; } // void display_value(int *nbr) {

23.03.13. assigning NULL to ptr (concept)

C
2 years ago
int main() { char * x = NULL; if (x==NULL) printf("is NULL\n"); return EXIT_SUCCESS; }

24.03.12 arr ADT (ver2)

C
2 years ago
#include <stdio.h> #include <unistd.h> struct Arr { char A[20]; int size; int len; };

24.03.12 arr ADT ()

C
2 years ago
/** what to do? make an array(len:5, size:10) and display it, using struct -use a strcut: struct Arr{} -write a function: void Display(struct Arr arr) -int main() { struct Arr arr = {{1,2,3,4,5},5,10}; Display(arr); } **/

24.03.12 arr ADT (ver2)

C
2 years ago
/** what to do? make an array(len:5, size:10) and display it, using struct -use a strcut: struct Arr{} -write a function: void Display(struct Arr arr) -int main() { struct Arr arr = {{1,2,3},5,10}; Display(arr); } **/

24.03.12 int arr ADT (concept)

C
2 years ago
#include <stdio.h> #include <stdlib.h> #include <unistd.h> struct Arr { int *A; int size; int len; };

c00_ex07 ft_putnbr (final)

C
2 years ago
#include <unistd.h> void func(int nb) { char digit; if(nb == -2147483648) write(1, "-2147483648", 11); else if(nb < 0) { write(1, "-", 1);

C01_ex07 : ft_rev_int_tab (concept)

C
2 years ago
void ft_rev_int_tab(int *tab, int size) { int idx; int temp; idx = 0; while (idx <= size / 2) { temp = tab[idx]; tab[idx] = tab[size - 1 - idx];

24.03.12 Static/global Variables in Recursion

C
2 years ago
#include <stdio.h> //Static Var in Recursion int fun1(int n) { static int x=0; if(n>0) { x++; return fun(n-1)+x; } return 0;

24.03.11 assign int to ptr

C
2 years ago
#include <unistd.h> #include <stdio.h> #include <stdlib.h> void ft_rev_int_tab(int *tab, int size) { int i; int temp; i = 0 ;

24.03.11 : ptr: malloc, assign null to ptr, if ptr != NULL

C
2 years ago
#include <stdlib.h> #include <stdio.h> void my_function(char **); // Change char* to char** int main(int argc, char *argv[]) { char *ptr; ptr = malloc(10); if(ptr != NULL) printf("FIRST TEST: ptr is not null\n");

c01_ex04: ft_ultimate_div_mod (assigning temp to ptr: right and wrong way)

C
2 years ago
#include <unistd.h> #include <stdio.h> void ft_ultimate_div_mod(int *a, int *b); int main(void) { printf("ex04\n"); int *ptr1; int *ptr2;

c00_ex07: ft_putnbr (final ver)

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