Some compilers (like GNU) convert the C/C++ code into assembly code. A tool called "assembler" converts the assembly code into machine code and a tool called "linker" connects multiple machine-code files into one single executable (.EXE under Windows) file. Most of these compilers allow you to write the resulting assembler code into a file so you can look at the assembler code or modify it.
The assembler and the linker are part of the tool chain which means that they are typically delivered together with the compiler.
Some compilers (like Microsoft) however directly convert C/C++ code into machine language so no assembler is needed any more. Many of these compilers are not able to create assembler code so you cannot write the assembler code into a file.
By the way: There are even compilers (not for C/C++, but for other programming languages) that directly create an .EXE file so no linker is required.