Let's try creating a simple program using basic development tools.
- Prerequisite: C development environment setup
Creating the First CLI Program in C
C is one of the oldest languages that are widely used at this point. C does not have "modern" tools like package managers or project scaffolding commands.
Most C developers use good ol' makefiles.
Or, as we describe in the C++ post, for example,
we can also use cmake
.
Given a file hello-world.c
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
}
As an example, we can compile and run the program using gcc as follows (without using makefile):
$ gcc hello-world.c
$ ls
a.out hello-world.c
$ ./a.out
Hello, World!
C++ C# Clojure Crystal D Dart Erlang F# Go Haskell Java Javascript Julia Kotlin Lua Python Rust Scala Swift Typescript