ft_lstnew: showcase how to use int as content
This commit is contained in:
parent
c3a67f660b
commit
d971555797
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue