this code works:
void main (void)
{
write (1, "1", 1);
}
this one works too:
void putchar(char c)
{
write (1, &c, 1);
}
void main (void)
{
putchar('1');
}
but this one doesn’t :
void main (void)
{
write (1, '2', 1);
}
in the second code, c is a character (not a pointer), so why is there & before c ?