C is a general-purpose programming language. It is compiled to machine code, it gives the programmer direct control over memory through pointers, and it has a small core. C dates to the early 1970s and is still used for operating systems and embedded devices. C++ grew out of it, so learning C teaches many ideas that carry over.
Where C came from
Dennis Ritchie developed C at Bell Labs in the early 1970s. Much of the Unix operating system was written in C, which helped the language spread. The 1978 book The C Programming Language, by Brian Kernighan and Dennis Ritchie, became the standard reference for many years and is still often called K&R.
A first C program
This program prints a line of text:
#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
return 0;
}
Save it as hello.c, then compile and run it. On most systems:
gcc hello.c -o hello
./hello
The #include line brings in the declarations for printf. The main function is where the program starts, and return 0 tells the system the program finished successfully.
Core ideas
C has integer types such as int and char, and floating-point types such as float and double. The basic types are covered in primitive data types in c. Functions take typed arguments and return a value:
int add(int a, int b) {
return a + b;
}
Pointers store the address of a value. The & operator takes an address, and * reads the value at an address:
int count = 5;
int *ptr = &count;
printf("%d\n", *ptr); /* prints 5 */
Structs group related values into one type:
struct point {
int x;
int y;
};
C has no garbage collector. The program allocates memory with functions such as malloc and releases it with free, so tracking that memory is part of the job.
What C is used for
C is widely used for operating system kernels, device drivers and embedded systems, where small programs and direct hardware access matter. It is also common in older code bases that have run for decades.
C is often called a low-level language. That label needs some explanation, which is covered in is c a low level language.
How C relates to C++
C++ began as an extension of C and still accepts most C code, but it is a separate language with its own features and standard. Classes, references, templates and the standard library are the main additions. The differences are covered in are C and C++ the same.
Where to start
Start with variables, types, control flow, functions, arrays, pointers and structs. The language has had several ISO standards, including C99 and C11. For how those revisions differ, see what are C standards.
If your goal is C++, you can start with C++ directly. Its syntax includes most of C’s, and the C++ additions are the next step. Whether C is still worth learning in 2026 depends on what you plan to build, so it is worth checking the goals before you commit.