minishell/math/main.c
2024-05-29 16:24:37 +02:00

37 lines
1.4 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/27 14:41:26 by rparodi #+# #+# */
/* Updated: 2024/05/29 16:16:28 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include "./includes/ft_math.h"
int main(int argc, char *argv[])
{
t_number *nb;
nb = (t_number *)malloc(sizeof(t_number));
if (argc != 2)
{
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);
}