SITERAW

What is C Programing?

Hello! Welcome to my C programming course for beginners!

I'll be your guide (or "teacher" if you prefer) throughout this course. I've already created several tutorials for SiteRaw, including ones on building websites with HTML and CSS. So, this isn't my first time writing a beginner-friendly lesson.

But enough about me — let's talk about you. You're here for a specific reason: you want to learn how to code. You know next to nothing about programming, you're not even quite sure what programing actually is, and yet... you want to learn it, no doubt.

But programming in C... What does that even mean? Is this course a good place to start? Are you ready for it? Can you really do everything and anything with this language?

This first chapter is here to answer all those seemingly silly but absolutely essential questions (the answer to most of which is "yes" btw).

By the end of this chapter, thanks to these simple questions, you'll have a clear idea of what lies ahead. And hey — knowing what you're learning and why can only help, right?

What is programming, anyway?

Let's start with the simplest question of all — the most basic of all basic questions.

If you think you already know this stuff, I still suggest reading on — it won't hurt, I promise! I'm starting from absolute scratch here, so I've got to ask:

What does the word "programming" mean?

Now don't worry, I won't go full English teacher on you — I'm not about to give you the word's etymology. And even if I did tell you it came from the Greek prographein, you probably wouldn't believe me anyway. 😄

Put simply, programming means creating "computer programs." Programs are sets of instructions that tell your computer what to do.

Your computer is packed with all kinds of programs:

  • The calculator is a program
  • Your web browser is a program
  • Your word processor is a program
  • Your chat app is a program
  • Video games are programs

Programs are everywhere, and they let you do just about anything you can imagine on a computer. You could invent a groundbreaking cryptocurrency encryption tool if that's your thing, or build an online 3D fighting game — whatever floats your boat. Your computer can do it all (well, except making coffee, but we're working on it).

Just to be clear: I didn't say making a video game is easy as pie. I only said it's possible. But yeah, be ready — it takes a lot of work.

Since you're just starting out, we're obviously not going to jump into making a 3D game. That'd be total suicide.

We'll begin with very simple things. One of the first things we'll cover is how to display a message on the screen. I know — it doesn't sound that exciting, but trust me, even that's trickier than it looks. Sure, it won't exactly blow your friends away, but it's a step we have to take.

Little by little, you'll pick up the skills you need to start making more complex programs. The goal of this course is to get you to the point where you can confidently navigate any C program on your own.

But hey, speaking of which — do you actually know what this whole "C language" thing is all about?

Programming... in what language?

Your computer is a weird machine, to say the least. You can only "talk" to it by sending it a stream of 0s and 1s. So, if I wanted to say "Show me the result of 7 + 5" in computer-speak, it might look something like:

10010110100010010100111101

(I'm making that up, by the way — I don't know the exact binary translation by heart!)

What you're seeing here is your computer's native tongue, known as binary. That's the only language your machine actually understands — and as you can clearly tell, it's completely unreadable for normal human beings. 😄

So, here's our first real problem:

How can we talk to a computer in a way that's easier than using 0s and 1s?

Your computer doesn't understand English. But writing a program directly in binary is just... unthinkable. Even the most hardcore computer scientists wouldn't go that far — seriously!

So, what clever folks in computer science did was invent new languages — languages that could be translated into binary for the computer to understand. The hard part was building the tool that does the translating. Thankfully, some smart devs already took care of that for us (phew!).

So now, we can write something like "Do the calculation 7 + 5," and the translator program turns it into something like "10010110100010010100111101."

High-level and low-level languages

I've been keeping it simple, but you should know that in computer science, everything has a proper term. And as we go through this course, you're going to pick up quite a bit of technical vocab. Not only will it help you sound like you know what you're doing (😄), but when you eventually talk to other programmers (and you will), you'll actually understand each other. Sure, regular folks might start looking at you like you're from another planet — but don't worry about that!

There are different "levels" of programming languages. The higher the level, the closer the language is to natural human language (like English). So a high-level language is easier to use (yay! 😊), but — as we'll see later on — it comes with a few trade-offs.

There are loads of programming languages out there, each more or less high-level. Here are just a few examples:

  • Assembly
  • C
  • C++
  • C#
  • Java
  • PHP
  • Python
  • JavaScript
  • SQL
  • Ruby

Note: I haven't listed these in order of language level — so don't go thinking the first one is easier or harder than the last. They're just a few random examples that popped into my head.

(And apologies to all supreme autists for not including their favorite langage — making a full list would take forever!)

Question: What's this "language level" business all about?

In short — and without diving too deep — programmers have classified programming languages based on how close they are to either machine-level code (binary) or to human languages (like English). This has more to do with how programming is done than with grammar or spelling — things like memory management, architecture, abstraction levels, and so on.

Some languages are higher-level than others, which generally makes them easier to use. A little later on, we'll look at how C compares to other languages like Python or Assembly, just to get a sense of where it fits.

So is C a high-level or low-level language?

A bit of both, actually! C is hard to pin down, and trying to do so has sparked many passionate debates among programmers. 😅

To keep things simple — and to avoid setting off any major arguments — we'll say C is a mid-level language. It's too far removed from Assembly or machine code to be considered truly low-level, but also not abstract enough to be called a high-level language like Python, Ruby, Perl, or PHP.

One more term you should know: source code. Source code is just the program you write using a high-level language. So you will be the one writing the source code, which will then be translated into binary.

And speaking of translating — let's talk about that "translator" program that converts your C (or C++) code into binary. That program has a name: it's called a compiler. And the act of converting your source code into binary is called compilation.

Important note: There's a different compiler for each programming language. Which makes total sense — each language is different, so you can't translate C# the same way you would Delphi, for example. 💡

You'll soon discover that even within a single language — like C or C++ — there are multiple compilers! There's Microsoft's compiler, the GNU compiler, and so on. We'll go over all that in the next chapter.

Thankfully, all those compilers work almost the same way (though there are some small differences here and there, which we'll learn to spot).

Finally, the binary program that the compiler creates is called the executable. That's why, at least on Windows, programs usually have the ".exe" file extension — it stands for EXEcutable.

Why choose to learn C?

As I mentioned earlier, there are tons of high-level programming languages out there. So... should you start with one in particular? That's a big question.

Still, you've got to start somewhere — you have to pick one language to begin your programming journey. And when it comes down to it, you really have two main options:

  • A very high-level language: These are generally easy to use and more "mainstream." Think Python, Ruby, Visual Basic, and others. They usually let you write programs faster, which is great. But they also require extra files or tools (like an interpreter) to actually run the code.
  • A language that's a bit lower-level (but not too low!): These might be a little trickier to work with at first, but with a language like C, you'll learn so much more about how programming works, and how your computer works under the hood. And that deeper knowledge will make it way easier to learn other programming languages later on. You'll be far more independent.

To put it simply: once you know C, picking up another language is a breeze. The reverse isn't always true. And besides, C is still one of the most widely used languages in the world — even many other languages (like PHP) are themselves written in C. That's right. Major programming Inception.

Those are the main reasons I chose to teach you C instead of any other language. I'm not saying it's the only way to start, but I do believe it's a smart choice — one that'll give you solid, lasting knowledge.

For the rest of this course, I'll assume this is your very first programming language, and that you've never coded before.

If, by any chance, you've already dabbled in a bit of programming, it won't hurt to go back to square one. And if you've messed around with some high-level languages — like the aforementioned PHP or Python — then learning C will give you a better understanding of programming logic in general (really, you'll see!).

I've heard of C++. How's that different from C? Is C++ like a "new version" of C?

Not exactly — but almost. C++ is based on C (as are many modern languages), but it's its own separate language. That said, C++ is very close to C. Once you've got the basics of one, switching to the other is really easy. But C++, and other more advanced languages like C#, aren't "better" than C — not at all. They just serve a different purpose, mainly adding extra features, most of them related to object-oriented programming (OOP).

Here's a quick history breakdown to help you understand the difference before we go any further:

  • Back in the day — when computers were the size of a house and weighed as much — a language called Algol was created.
  • That eventually evolved into CPL, which became BCPL, which then gave birth to a language simply called B. (Don't worry if you can't remember all of that — honestly, I'm just showing off with some history flex.)
  • Then came C, yet another new language in the chain. While it has gone through some changes since, it's still one of the most widely used languages today.
  • Later on, people proposed adding new features to C — like improvements and enhancements. That's how C++ was born. It's basically the C language... but with extras (like objects, polymorphism, inheritance, and a few other features).

Let's clear up a common misconception: C++ is not "better" than C. It just lets you program differently. And C is not some ancient, forgotten relic — far from it. It's still heavily used today, and forms the foundation of major operating systems like Unix, and by extension Linux and Mac OS, and even Windows.

Is programming hard?

Now there's a question that's probably eating away at you right now!

So, do you have to be some kind of math genius with ten years of university under your belt to start programming?

The answer — rest assured — is no.

Nope, you don't need to be a math whiz. In fact, all you really need to know are the four basic operations:

  • Addition (hopefully you've got that one down 😛)
  • Subtraction (getting spicy)
  • Multiplication (the horror!)
  • Division (why did everyone suddenly go silent?)

I really hope you're familiar with those! Just to be safe, I'll explain how computers actually perform these operations in a later chapter.

So when it comes to math, nothing here is unmanageable.

Of course, it all depends on the kind of program you're trying to make:

If you're aiming to build an encryption tool, then yes, you'll need to know some advanced math and cryptography skills.

If you're planning to dive into 3D programming, you'll need some spatial geometry in your toolbox.

But those are specific cases.

To simply learn the C language, you don't need any deep or specialized knowledge in anything at all.

So... where's the catch? What is the hard part?

Well, you do need to have some idea of how a computer works in order to understand what you're doing. But don't worry — I'll walk you through all of that step by step.

There are also a few personal qualities that make programming easier:

  • Patience: Programs rarely work on the first try. You've gotta keep at it!
  • Logical thinking: You don't need to be great at math, true — but you will need to think things through (sorry, no escaping that one).
  • Calmness: Please don't smash your keyboard with a hammer. That's not gonna make your code run any better. 😅

In short:

There are no strict knowledge requirements to start programming.

You can be terrible at math and still do just fine — as long as you're willing to sit down and think things through patiently. And honestly, a lot of people end up discovering that they actually love it. (Granted, those people are a bit weird... but to each their own!)

The right tools for coding

After a first chapter full of boring (but necessary, let's be honest!) theory, we're almost ready to get into the real stuff. We just need to answer the big question.

What software do you need to start programming?

Don't worry — this final part of the first chapter isn't going to be hard. We'll just take the time to get familiar with a few new tools.

So enjoy it while it lasts! In the next chapter, we'll actually start writing code, and it definitely won't be nap time anymore.

So, what do you think? What kind of tools does a programmer need? If you've been paying attention in this chapter, you should already know at least one!

Have an idea? No clue?

That's right — it's the compiler! That magical tool that turns your C code into binary!

As I briefly mentioned earlier, there are quite a few different compilers for the C/C++ languages. But don't worry — choosing one isn't going to be complicated for us.

Okay, what else do we need? No need to guess — I won't keep you in suspense any longer!

Here's the absolute bare minimum for any programmer:

  • A text editor to write your program's source code (in C, or any other language). Technically, something like Notepad on Windows or vi on Linux will do the job. But ideally, you want a smart editor that highlights your code automatically — it'll help you find your way around much more easily.
  • A compiler to turn your source code into binary ("compiling" it).
  • A debugger to help you hunt down errors in your program (sadly, no one has invented an "auto-fixer" that just corrects our mistakes for us).

Technically, if you're a total daredevil, you could get by without a debugger. But let's be honest — I know that in five minutes, you'll come crawling back, asking me where to find a good one.

From here, we've got two options:

  • You can install each of these three tools separately. This is the trickier method, but it works! On Linux, in particular, many developers prefer using separate tools. I won't go into this approach here — we'll focus on the simpler one.
  • You can use an all-in-one "3-in-1" program that combines a text editor, a compiler, and a debugger.
  • These "3-in-1" tools are called IDEs — short for Integrated Development Environments.

Choose Your IDE

I thought it'd be helpful to introduce you to some of the most well-known IDEs. The good news? They're all free! Personally, I jump between a few of them depending on my mood. 😉

  • One of my favorite IDEs is Visual Studio Code. It's free and works on most operating systems. I recommend starting with this one (and you can totally stick with it later too if you like!). Works on Windows, Mac, and Linux.
  • The slightly more advanced (and paid) version is Visual Studio. Originally, it's a commercial product (and a pricey one at that!), but there's a free trial version that's excellent — the differences from the paid version are minimal. It's a super complete IDE, with a powerful built-in debugger. Windows only.
  • On Mac OS X, you can use Xcode, usually included with the system install CD. It's a popular IDE among Mac developers. Mac only.
  • For Linux users: there are plenty of IDEs on Linux, but experienced programmers often skip the IDE altogether and compile everything by hand. That's a bit more advanced, though — you'll have time to learn that later. For now, we'll use an IDE. I suggest installing Visual Studio Code if you're on Linux, so you can follow along easily.
  • And finally, for the hardcore coders, you can always go old-school: use Notepad (or any editor like Sublime Text) and pair it with the ultra-lightweight Tiny C Compiler (TCC). Just be warned — you won't get much help debugging, so this route is best for folks who already know their stuff. But the big advantage? TCC is incredibly lightweight and portable — barely anything to install, and you can pretty much access it anywhere.
Which one is the best IDE?

All of these IDEs will let you program and follow the course with no issues. Some have more features, others are a bit more user-friendly — but no matter which one you choose, the programs you write will be exactly the same.

So really, the choice isn't as critical as it might seem.

Throughout this course, I'll be using Visual Studio. If you want your screen to look exactly like mine — especially at the beginning, so you don't get lost — I recommend starting by installing Visual Studio.

Learn C Programing for Beginners

Enjoyed this C / C++ course?

If you liked this lesson, you can find the book "Learn C Programing for Beginners" from the same authors, available on SiteRaw, in bookstores and in online libraries in either digital or paperback format. You will find a complete C / C++ workshop with many exclusive bonus chapters.

More information