/* hello.c - a UNIX-style "Hello, World!" program * * To compile: gcc -o hello hello.c * To execute: ./hello */ #include // referencing the C library; stdio is the standard I/O operations int main() // everything needs a starting point, in C, that is a function called main() { // when you have a group of statements, wrap them in a code block using the curly braces int i = 0; // as C is lower level, variables need types assigned and declarations. char *msg = "Hello, World!\n"; // A "*" denotes a memory variable, aka pointer while (*(msg+i) != '\0') // keep looping while the currently read character from msg is not '\0' fputc(*(msg+i++), stdout); // display currently read character to STDOUT return (0); // all done, notify the system all went according to plan } // close code block