What is an executable image, and what is the difference between “.out” and “.o”?

I stumbled upon the terminology of “executable image” in the Hello World module of the “Learn C++” course, specifically in the “Compile & Execute” reading.

I searched online for an executable image, and I got this definition:

An executable image of a program is the program captured in a state that is executable. It is a frozen image, just an image, a still, of the program on disk that can be loaded as is and control can be passed to it, brought to life from that point on. An image implies that it’s not only an image as in a snapshot of the program state but one that is ready to be executed and control can be passed to it and it can correctly operate and do its own thing.

However, I still need clarification on it. Any explanation of what is an executable image is highly appreciated.

Another query I have is on this quote which is located in the Hello World module of the “Learn C++” course, specifically (again) in the “Compile & Execute” reading:

A compiler translates the C++ program into machine language code which it stores on the disk as a file with the extension .o (e.g. hello.o ).

However, while doing the Hello World module’s lessons, all the executable files we deal with end in “.out” not in “.o.” I am confused because Codecademy introduced this new file extension in the reading without dealing with it in the previous lessons. So, what is the difference between “.out” and “.o” in C++?

Thank you!

Hi!

This is the first time I seen the word executable image, and from what I have searched so far, it should be another name for the final executable file / application where you can simply run it (Correct me if im incorrect).

For your second question, .o is the binary / object code generated from the compiler. However, it is not executable on it’s own. It is the “Compile” Process in C++ “Compile & Execute”.
Then it’s the linker work, to combine various .o files and Program libraries into a single executable (.exe / .out).

Linker - GeeksforGeeks.


Image from Wikipedia

You can see that obj are object codes, which are .o files.

Hope this helps