comment out main ex04 ex05

This commit is contained in:
tosu 2023-03-30 21:31:14 +02:00
parent 5cc9a9fdc5
commit 883121aef7
2 changed files with 18 additions and 4 deletions

View File

@ -1,6 +1,5 @@
#include <unistd.h> #include <unistd.h>
#include <limits.h> #include <limits.h>
#include <stdio.h>
unsigned int char_count(const char *str, char c) unsigned int char_count(const char *str, char c)
{ {
@ -77,8 +76,9 @@ void ft_putnbr_base(int nbr, char *base)
} }
#define START /* ////
#include <stdio.h> #include <stdio.h>
#define BASEINVALID1 "01234567890"
#define BASE10 "0123456789" #define BASE10 "0123456789"
#define BASE2 "01" #define BASE2 "01"
#define BASE3 "012" #define BASE3 "012"
@ -91,6 +91,11 @@ int main(void)
{ {
char *base; char *base;
base = BASEINVALID1;
printf("BASE '%s'\n", base);
printf("Input: <%d> Output: <", 123); fflush(stdout); ft_putnbr_base(123, base); printf(">\n");
printf("\n");
base = BASE10; base = BASE10;
printf("BASE '%s'\n", base); printf("BASE '%s'\n", base);
printf("Input: <%d> Output: <", INT_MIN); fflush(stdout); ft_putnbr_base(INT_MIN, base); printf(">\n"); printf("Input: <%d> Output: <", INT_MIN); fflush(stdout); ft_putnbr_base(INT_MIN, base); printf(">\n");
@ -420,3 +425,4 @@ int main(void)
return (0); return (0);
} }
*/ ////

View File

@ -1,5 +1,3 @@
#include <stdio.h>
unsigned int char_count(const char *str, char c) unsigned int char_count(const char *str, char c)
{ {
unsigned int count; unsigned int count;
@ -81,7 +79,9 @@ int ft_atoi_base(char *str, char *base)
return (sign * abs); return (sign * abs);
} }
/* ////
#include <stdio.h> #include <stdio.h>
#define BASEINVALID1 "01234567890"
#define BASE10 "0123456789" #define BASE10 "0123456789"
#define BASE2 "01" #define BASE2 "01"
#define BASE3 "012" #define BASE3 "012"
@ -95,6 +95,11 @@ int main(void)
char *base; char *base;
char *input; char *input;
base = BASEINVALID1;
printf("Base: %s\n", base);
input = "123"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base));
printf("\n");
base = BASE10; base = BASE10;
printf("Base: %s\n", base); printf("Base: %s\n", base);
input = "-2147483648"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base)); input = "-2147483648"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base));
@ -573,4 +578,7 @@ int main(void)
input = " +-+-d"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base)); input = " +-+-d"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base));
input = " +-+-d"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base)); input = " +-+-d"; printf("Input: <'%s'>, Output: <%d>\n", input, ft_atoi_base(input, base));
printf("\n"); printf("\n");
return (0);
} }
*/ ////