Does the C++ code compile to assembly codes?

前端 未结 3 1909
鱼传尺愫
鱼传尺愫 2021-02-07 02:16

Does C++ code compile to assembly code? If we have C++ code, will we be able to get assembly code?

3条回答
  •  野的像风
    2021-02-07 02:39

    It depends on the compiler. There are no real rules what c++ compiles into, except at some point it should be able run on a computer. Most compilers has a switch to compile to assembly.

    With gcc you can add -S to compile into a .asm file.

    For visual studio see http://codegem.org/2008/10/generate-assembly-from-c-code-in-visual-studio

提交回复
热议问题