Reputation: 21
I am new to programming. Additionally, I am super confused about compiling, debugging, executing, running. What does each of them mean and what starts first? Thanks.
Upvotes: 1
Views: 4299
Reputation: 1
Compiling, debugging, executing, and running are all fundamental concepts in software development, particularly in the context of programming languages and software programs. Here's an explanation of each term:
- Compiling:
Compiling is the process of translating human-readable source code written in a programming language (such as C, C++, Java) into machine-readable code, typically in the form of binary executable files. The compiler checks the source code for syntax errors, resolves references between different parts of the code, and generates the corresponding machine code. This step results in a compiled program that can be executed by the computer's processor.
- Debugging:
Debugging is the process of identifying and fixing errors or bugs in a program. Bugs can manifest as unexpected behavior, crashes, or incorrect output. Debugging involves various techniques and tools to locate the source of the problem, such as using breakpoints, stepping through code, inspecting variables, and analyzing error messages. Debugging aids in making the program function correctly and as intended.
- Executing:
Executing refers to the act of running a compiled program or script on a computer's processor. When a program is executed, the processor interprets and carries out the instructions present in the program's machine code. The program's logic is executed, producing the expected output based on the input and the algorithm defined in the source code.
- Running:
Running is a more general term that encompasses the entire process of preparing, executing, and interacting with a software program. It includes compiling (if necessary), executing, and dealing with any runtime issues that might arise. When a program is running, it's actively processing data, performing calculations, and responding to user interactions.
In summary:
Compiling involves translating source code into machine code.
Debugging focuses on finding and fixing errors in the code.
Executing involves running the compiled machine code on the computer's processor.
Running encompasses the entire process of preparing, executing, and interacting with a software program.
Upvotes: -1
Reputation: 158
without make it complicated
the main folder:
PROJECT
│
├─ README.md
│
└─ main.c
#include<stdio.h>
int main(void)
{
char ch = 'd';
printf("hello worl%c",ch);
return 0;
}
open the terminal in this folder and enter:
gcc -o build/out main.c
than this is what we should see
PROJECT
│
├─ README.md
│
├─ build
│ └─ out
│
└─ main.c
<!-- build is just the name of the
folder were the executable is placed -->
open the terminal in this folder and enter:
./build/out
# result:
# > ./a.out
# hello world
Upvotes: 2