Memory: Physical memory, like RAM, hard-disk, and such.
Virtual Memory: is a memory management technique that gives an application the illusion of having more memory available than physically exists on the system. It accomplishes this by using a combination of RAM and hard disk space to create a larger, virtual address space.
Address Space: Each process running on a system has its own virtual address space, which is a logical view of memory. This space can be much larger than the physical RAM installed.
Pages: The virtual address space is divided into fixed-sized blocks called pages.
Page Table: The operating system maintains a page table for each process. This table maps virtual addresses to physical addresses.
Paging: When a program accesses a memory location, the operating system translates the virtual address into a physical address using the page table. If the required page is not in physical memory (a page fault), the operating system brings the page from the hard disk into RAM and updates the page table.
When a program requests memory, it uses virtual addresses. The operating system translates these virtual addresses into physical addresses using the page table. If the required page is not in main memory (a page fault occurs), the operating system brings the page from secondary storage into memory and updates the page table.
The null character, represented as \0 in C-like languages, is a special character with an ASCII value of zero. It's often referred to as the null terminator because its primary purpose is to mark the end of a string.
Key points about the null character:
String termination: In C-style strings, \0 indicates the end of the string. This allows functions like strlen to determine the length of a string by searching for the first null character.
Character representation: It's a valid character, but its primary use is as a string terminator.
Other uses: While less common, it can be used in other contexts, like binary data or specific data structures.
Dynamic memory allocation refers to the process of requesting memory from the system at runtime, as opposed to static allocation where memory is assigned at compile time. This flexibility allows your program to adapt to changing data sizes and avoid unnecessary memory wastage.