A programmer can directly access executable code from the Code Segment and contents inside the Stack segment only.
The memory allocated in the heap section can not be accessed directly by the programmer. Indeed, the data segment is indirectly access through the use of global variables and static variables.
int globalVariable = 42; // This is a global variable
int main() {
// Accessing the global variable
int value = globalVariable;
return 0;
}
Moreover, programmers can interact with the files either through lower-level file I/O functions using file descriptor or through higher-level file I/O functions using pointers.