Adding the negative number
This commit is contained in:
parent
e8a89c456e
commit
1960bbc47a
4 changed files with 21 additions and 12 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* 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 */
|
||||
/* Updated: 2024/05/29 16:16:28 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -15,8 +15,9 @@
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
t_number nb;
|
||||
t_number *nb;
|
||||
|
||||
nb = (t_number *)malloc(sizeof(t_number));
|
||||
if (argc != 2)
|
||||
{
|
||||
printf("Usage: %s <string>\n", argv[0]);
|
||||
|
|
@ -24,13 +25,13 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
else if (argc == 2)
|
||||
{
|
||||
if (ft_init_numbers(argv[1], &nb) == ERROR)
|
||||
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);
|
||||
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