Software Introductory clues on how C/C++ programming works.

Software related topic.

esselfe

New member
Jul 2, 2025
4
0
1
Montreal, Quebec, Canada
esselfe.ca
Pronouns
He/Him
Shell
  1. Bash
Editor
  1. Vim
Desktop
  1. XFCE
I will try to outline grossly how working with the C/C++ programming languages works out normally. It's a good place for newcomers as those languages a pretty simple to learn and start grasping a workflow.

I won't cover the history and more complex concepts, since it's very well documented on the WWW. I will also focus on C for brevity, but C and C++ are quite similar on the practical point of view.

As I see it, there's 2 way to setup an environment for programming... it's either in a terminal, or it's in an IDE (Integrated Development Environment). Most IDEs are straightforward and beasts of their own league, so I will only cover the terminal approach.

Your first clue is here: find the terminal provided by your distro, or install one using the package manager, it can be gnome-terminal, xfce4-terminal, lxterminal, urxvt, xterm, kitty, etc.

The second clue is: prepare a workspace somewhere in the storage filesystem, preferrably in your $HOME folder. Personally, here I create directories for projects in "/home/esselfe/code/".

Then you have to know that C is written in plain text files and a project can be split into multiple ".c" files and ".h" headers. So if you want to program in C, you will need a text editor, like nano, vim, gedit, kate, etc.

The main idea is to write code, compile it with a compiler like gcc or clang, and have it produce an executable binary program. The code and compilation operations can also be used to produce shared libraries, which programs can use after being linked with them.

Here's the classical Hello World program written in C:
C:
#include <stdio.h>

int main(int argc, char **argv) {
    printf("Hello World!\n");
   
    return 0;
}

Then in a terminal after changing directory to the project's location, you can run:
Bash:
gcc hello.c -o hello
ls -l hello
./hello

Now you have a good idea, it's as simple as that! :)
 

About Us

  • The Linux.Chat community is a multi-platform community for general Linux® support. We provide help and support for any Linux® distribution and aim to answer any questions you might have about Linux®. Discussion about the various aspects of Linux® and Free/Open Source software is also encouraged.

    Visit our communities website at Linux.Chat.
  • Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.

Quick Navigation

User Menu