Welcome back to yet another installment in the Hello World in Every Language series. Today, we’re fortunate to have another community submission—this time from Muhammad. Thanks to them, we’re able to cover Hello World in C*, an object-oriented superset of C which first appeared in 1987.
Table of Contents
C* Background
According to Wikipedia, C* is a language that was originally designed as an alternative to *Lisp and CM-FORTRAN. Beyond that, there’s really not much documentation. In fact, if you drop down below, you’ll see that I don’t even know how to run C*.
That said, I did manage to dig up the user guide for C* if you want to play around with that. If you have any additional documentation, let me know in the comments.
Hello World in C*
At long last, here’s Hello World in C*:
#include <stdio.h> main () { printf("Hello, World!") }
As we can see, Hello World in C* looks alarmingly 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.
Up first, we have the include statement which pulls in the stdio header. With the standard IO header included, we’re able to write to standard output using printf.
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 printf which is a special print function that allows for string formatting. Of course, all we’re going to pass to it is the “Hello, World!” string. And, that’s it!
How to Run the Solution
Unfortunately, I haven’t found a way to execute C* programs. That said, I did find a handful of open-source C* compilers, so maybe those can help us out:
In addition, the user guide does detail how to compile and run C* programs. But, again, that information isn’t super helpful without the compiler.
If you know of an official compiler, let me know in the comments.
Sample Programs in Every Language
Well, that’s it for Hello World in C*. If you liked this article, don’t forget to give it a share. And, if you’re interested in contributing, check out the Sample Programs repository.
Thanks for stopping by and a special thanks to Muhammad for sharing the solution. Every little bit helps grow the series, so thanks again. Until next time!
Recent Posts
Recently, I was thinking about the old Pavlov's dog story and how we hardly treat our students any different. While reflecting on this idea, I decided to write the whole thing up for others to read....
In the world of programming languages, expressions are an interesting concept that folks tend to implicitly understand but might not be able to define. As a result, I figured I'd take a crack at...