Hello World in CLIPS

Our first program will print the classic “hello world” message. Here’s the full source code.

#include <iostream>

int main() {
    std::cout << "hello world" << std::endl;
    return 0;
}

To run the program, save the code in hello-world.cpp and use a C++ compiler to compile and execute it.

$ g++ hello-world.cpp -o hello-world
$ ./hello-world
hello world

Sometimes, we’ll want to build our programs into binaries. We can do this using a C++ compiler.

First, compile the code into an executable:

$ g++ hello-world.cpp -o hello-world
$ ls
hello-world    hello-world.cpp

We can then execute the built binary directly.

$ ./hello-world
hello world

Now that we can run and build basic C++ programs, let’s learn more about the language.