Learn C
#include "variablesdatatypes/fundamental_types.h"

Fundamental Data Types in C

#concept

C builds everything from a tiny set: int for whole numbers, double for decimals, char for single characters (really a small integer), and void for nothing. Sizes are platform-dependent by design — int is at least 16 bits but 32 nearly everywhere — so portable code uses <stdint.h> fixed-width types (int32_t, uint64_t) when exact size matters.

Choose by range and intent: double is the default floating type (float halves precision for little gain on modern hardware), char stores character codes as small integers, and _Bool/bool (via stdbool.h) makes conditions self-documenting.

#how it works
1

int: the workhorse

Whole numbers, typically 32 bits (~±2 billion). Default choice for counts, indexes, and IDs.

2

double: the default decimal

64-bit floating point with ~15 reliable digits. Prefer over float unless memory profiling says otherwise.

3

char: a tiny integer

Usually 8 bits holding a character code — 'A' is 65 in char-sized storage, and char arithmetic is legal integer math.

4

void and fixed widths

void means no value (function returns); int32_t/uint64_t from stdint.h guarantee exact sizes across platforms.

#example
#include <stdio.h>
 
int main(void) {
int n = 1000000;
double pi = 3.14159;
char grade = 'A';
printf("%d, %.5f, %c\n", n, pi, grade);
return 0;
}
Output
1000000, 3.14159, A
1Each variable declares its type up front — int, double, char — fixing size and operations.
2%.5f prints the double with exactly five decimals; %c prints the char as its character, not its code.
3One printf with three matching specifiers — mismatched specifiers would be undefined behavior.
#use cases
Picking double over float wherever precision matters
Using int32_t/uint64_t in file formats and protocols needing exact sizes
Remembering char arithmetic (grade + 1) is integer math for parsers
Matching every printf argument with its correct conversion specifier

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books

Practice what you learned

Re-implement each visualized algorithm in C yourself — building beats watching.