What is a contiguous memory block?
A block of memory which isn't interrupted by other memory. Or to be more precise it requires an uninterrupted block of virtual address-space. The real RAM backing that address space doesn't need to be contiguous.
This is important if you allocate a large memory block. The OS has to give it to you as a contiguous block, but if memory is so fragmented that only smaller pieces are free then this memory allocation cannot be satisfied even if the total free memory is larger than the requested space.
This isn't such a big problem on 64 bit apps since the address space is large there. But in 32 bit processes it can happen that the heap gets so fragmented(between freed blocks there are still unfreed blocks) that larger allocations fail.
One without any gaps in the addresses it occupies. You can probably just think of this as a "block", and think of something with a gap in the middle as "two blocks".
The term comes up in the definition of an array as being "contiguous". That means the elements are laid out end-to-end, with no discontinuities and no padding between them (there may be padding inside each element, but not between elements). So an array of 5 4-byte elements looks like this (1 underscore character per byte, the | symbols don't represent memory):
____ ____ ____ ____ ____
|____|____|____|____|____|
It doesn't look like this:
____ _ ____ _ ____ _ ____ _ ____
|____|_|____|_|____|_|____|_|____|
And neither does it look like this:
____ ____ ____ ____ ____
|____|____|____| ... somewhere completely different ... |____|____|
In all cases, "looks like" means "as far as the addresses visible in C are concerned". Something could be contiguous in virtual address space, but not contiguous in physical RAM. For that matter, something could be contiguous in physical RAM address space, but not actually adjacent in physical RAM. Half of it could be on one RAM chip over here, and the other half on another RAM chip over there. But the C memory model can't "see" any of that.
This is a contiguous memory block of five bytes, spanning from location 1 to location 5:
It represents bytes (colored light blue) that are together in memory with no gap bytes (white) between them.
This is a non-contiguous set of five bytes of interest:
It is fragmented into three groups of bytes (colored yellow) with gap bytes at locations 4 and 6. Starting at location 1 there is a contiguous block of three bytes, spanning from locations 1 to 3. There are two more blocks of one byte each at locations 5 and 7, respectively.
The unused block at location 0 as well as any subsequent blocks beyond location 7 can usually be ignored since they do interpose between the bytes of interest spanning from locations 1 to 7.