Hello World in C*

Published on 13 November 2018 (Updated: 13 November 2018)

Hello World in C*

Today, we’re able to cover Hello World in C*, an object-oriented superset of C which first appeared in 1987.

How to Implement the Solution

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!1

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.1


References

  1. J. Grifski, “Hello World in C*,” The Renegade Coder, 27-May-2018. [Online]. Available: https://therenegadecoder.com/code/hello-world-in-c-star/. [Accessed: 13-Nov-2018].  2