Repushing the correct version
This commit is contained in:
parent
d16b39091a
commit
e8a89c456e
3 changed files with 130 additions and 16 deletions
37
math/main.c
37
math/main.c
|
|
@ -1,17 +1,36 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/27 14:41:26 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/28 15:48:40 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "./includes/ft_math.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
t_number nb;
|
||||
t_number nb;
|
||||
|
||||
if (argc == 2)
|
||||
if (argc != 2)
|
||||
{
|
||||
ft_init_numbers(argv[1], &nb);
|
||||
printf("Number: %s\n", nb.number);
|
||||
printf("Integer: %s\n", nb.int_part);
|
||||
printf("Float: %s\n", nb.float_part);
|
||||
printf("Integer size: %zu\n", nb.int_size);
|
||||
printf("Float size: %zu\n", nb.float_size);
|
||||
printf("Usage: %s <string>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
else if (argc == 2)
|
||||
{
|
||||
if (ft_init_numbers(argv[1], &nb) == ERROR)
|
||||
{
|
||||
printf("Error\n");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
printf("Number = %s \n(int: %s, %zu) (float: %s, %zu)\n", nb.number, nb.int_part, nb.int_size, nb.float_part, nb.float_size);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue