A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Hello World in C* page! Here, you'll find the source code for this program as well as a description of how the program works.
void main()
{
println("Hello, World!");
}
Hello World in C* was written by:
This article was written by:
If you see anything you'd like to change or update, please consider contributing.
At long last, here's Hello World in C*.
As we can see, Hello World in C* looks similar to C. That said, C* is a superset of C, so this shouldn't be too much of a surprise. At any rate, let's dig in.
Unlike C, there is no include
statement. As far as I can tell, the language
does not actually have an include
statement or header files. Somehow, the
compiler know where to pull the definition for standard libraries.
Next, we have our usual main
function declaration which serves as the drop in
function for our program. We should be used to seeing this convention since it's
common in the popular industrial languages like C++ and Java.
Finally, we make a call to println
which is a special print function that outputs
the specified string with a newline character. Of course, all we're going to pass
to it is the "Hello, World!" string. And, that's it!
The compiler source can be found in the C* GitHub repository. To build it, just follow the build from source instructions for your particular OS. Once, you've built the compiler, download a copy of the Hello World in C* sample. Then, build and run the program like this:
cx -o hello-world hello-world.cx
./hello-world