|
|
Get started, Source files, object files, and executable filesWhy should I learn C?Because you want to be a C programmer! Because, learning to program C is an important skill to have in your chosen profession. Because, programming allows you to understand how computers work, and knowing how computers work is important in the modern days. Because, programming is an area of study that you need to master to complete your degree or studies. Because, C is a high level programming language that is extensively used in the industry, and relatively easy to learn. What is a high level programming language? Computers compute, and at the basic level composed of switches or transistors represented by 1010101 etc. But, you write programs in C. How does the codes in C changed into machine language and runs? I don't know. How does a C program runs in a computer that basically calculates using binary logic? C source code first get translated or compiled into an assembly code. A program written in C called a compiler translates your program into an assembly language program. Then, the assembly program is it self compiled by a program written in assembly language into a machine code program. Do I really need to understand what you are saying to write C programs? Yes. When you write a C program, you will save it as filename.C , which is your source file. But, in order to execute the file, you need a filename.exe, which is your execution file. But, before you could do that you need to compile the program into an object file. The compiler creates a file called filename.obj , which is an assembly language file. When the filename.obj gets fed to a translator which converts assembly program to machine language program, the machine language program is the executable file. You are confusing even more! What exactly are the three files involved in writing a C program? There are three type of files you will deal with when you are writing a basic C program. First is the program that write, which will have form filename.C. Second is the file that gets generated when you compile your source program, which has the form filename.obj. Third is the file that gets generated you link or translate the object program into the machine language program, which has the form filename.exe. Understand at least this much. |