Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม C

โปรแกรม C ทำงานอย่างไร? (Compilation Process)

ขั้นตอนการคอมไพล์โปรแกรม C:

  1. C Source Code - โค้ดที่เขียน
  2. Preprocessing - รวม Header Files (#include), Expand Macro (#define)
  3. Compiler - แปลงเป็น Assembly Code
  4. Assembler - แปลง Assembly เป็น Object Code (Machine Code ใกล้เคียง)
  5. Linker - ลิงก์ Object Code กับ Library อื่นๆ สร้าง Executable
  6. Loader - โหลด Machine Code ลง RAM เพื่อ Execute (กลายเป็น Process)

โปรแกรม C ทำงานอย่างไร? (Compilation Process)