Wednesday, March 4, 2009

New to the "C"ene

1: #include <stdio.h>
2: #include <stdlib.h>
3:
4: void main ( )
5: {
6: printf ("Beloved followers, \n I started learning
7: C today! \n Later! \n");
8: exit (0);
9: }
10:
11: /*
12: Compile that in your executable and smoke it.
13: First two chapters down. I would forget about
14: voiding the main function's return and just use
15: return (0) instead of the exit function, (which
16: would also allow me to forget about the #include
17: directive for stdlib.h), but it was the only way I
18: knew how to show off, that and through this
19: explanation... and newline characters! :)
20: Check my rad low block, said the white belt.
21: */

Also, I'd like to boast about displaying my angle brackets.

I haven't actually gotten a C compiler yet, so I'm not sure that my code will work. The guide I have, "Sams Teach Yourself C in 24 Hours," wants me to use Visual C++ version 1.5. Umm, history lesson!

1 comment:

Sterling "Chip" Camden said...

Woo hoo!

I remember Visual C++ 1.5 -- I think that was circa 1993.

I still program in C quite frequently. Your syntax looks fine, and should work in the latest C compilers just as well.

Oh, and congrats on your <>s