Originally Posted by
Inferno
Ive been reading my book through out the course of my day and ive found my self reading this example and its output over & over again.
Code:
#include <stdio.h>
main()
{
putchar(65);
putchar(10);
putchar(66);
putchar(10);
putchar(67);
putchar(10);
return 0;
}
now I get the gist of putchar but wat i dont get is why does it only prints
A
B
and not the other letters.
well you only have 4 different numbers - the numbers are ascii for A (65), B (66), and C(67) - the number 10 is '\n' or the newline character which makes your program display like this:
Code:
board $ ./putc
A
B
C
board $
as opposed to this:
by using this modified code:
Code:
#include <stdio.h>
int main(void)
{
putchar(65);
/* putchar(10); */
putchar(66);
/* putchar(10); */
putchar(67);
/* putchar(10); */
return 0;
}
If you changed your original code.
edit:: beaten again!
~/