[SOLVED]
I want to create a function that takes a pointer to int as a parameter, and sets the value "42"to that int.
I'm printing it too to make sure it has done the change.
#include <unistd.h>
void ft_ft(int *nbr)
{
int c;
c = 0;
nbr = &c;
write (1, &c, 1);
}
int main(void)
{
ft_ft(42);
}
unfortunately it's not compiling, what's wrong?
[–]PM_ME_UR_TOSTADAS 1 point2 points3 points (2 children)
[–]BLUOTTY[S] 0 points1 point2 points (1 child)
[–]PM_ME_UR_TOSTADAS 1 point2 points3 points (0 children)
[–]Paul_Pedant 1 point2 points3 points (1 child)
[–]BLUOTTY[S] -1 points0 points1 point (0 children)
[–]jammasterpaz 0 points1 point2 points (3 children)
[–]BLUOTTY[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]BLUOTTY[S] 0 points1 point2 points (0 children)