ft_lstnew: showcase how to use int as content

This commit is contained in:
Khaïs COLIN 2024-10-21 13:39:00 +02:00
parent c3a67f660b
commit d971555797

View file

@ -6,7 +6,7 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/21 11:19:42 by kcolin #+# #+# */
/* Updated: 2024/10/21 11:25:46 by kcolin ### ########.fr */
/* Updated: 2024/10/21 13:37:27 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
@ -32,8 +32,8 @@ int main(void)
{
t_list *list;
list = ft_lstnew("Hello There!");
printf("content:\t%s\n", (char *)list->content);
list = ft_lstnew((void *)123);
printf("content:\t%d\n", *((int *)&list->content));
printf("next:\t%p\n", list->next);
free(list);
return (0);