what is following C terminologies???

R

Rick Ng Chi Wah

Dear all,

I am a beginner of C language.
I want to know following C terminologies:

preprocessor
complier
object code
linker
executable file

What is the functions of these terms in a C program compilation
process??

Pls help me.
Thanks!

One more question, can compile DOS and Windows C source code under
Linux without any change/modify ??

Thanks!
 
E

Emmanuel Delahaye

In said:
I am a beginner of C language.
I want to know following C terminologies:
preprocessor

The 'preprocessing directives' are the statement beginning with #

#include ...
#define ...
#if ...
#ifdef ...
etc.

A 'preprocessor' is an utility program that takes the source files and
replace the 'preprocessing directives' with their actual values. (IOW, it
expands the macros, include the files, removes the not defines code etc.

It's an utily program that takes the preprocessed files and translate them to
machine code. Actually, the proprocessing opération is generally transparent.
The compiler takes the source files (.c) calls silently the preprocessor and
compiles the resultinf files to object files (machine code files).
object code

It's the binary code produced by a compiler. It contains mostly target
machine code, and some information about non-resolved references (external
calls)

It's an utily program that takes the objects files of a project and build the
resulting executable file. It attempts to solve all the external links.
executable file
One more question, can compile DOS and Windows C source code under
Linux without any change/modify ??

Yes, as far as the code is portable. Not all codes are portable. The one
being written in standard C have a better chance to be portable.
 
M

Malcolm

Rick Ng Chi Wah said:
One more question, can compile DOS and Windows C source code
under Linux without any change/modify ??
If the code is portable, yes.

This program will compile under DOS Linux or practically anything else
without modification

#include <stdio.h>

int main(void)
{
printf("Hello world\n");
return 0;
}

On the other hand, if you open a window in Windows you have to use
platform-specific code, so the program is not easy to port to other OSes.
 
O

osmium

Malcolm said:
If the code is portable, yes.

This program will compile under DOS Linux or practically anything else
without modification

#include <stdio.h>

int main(void)
{
printf("Hello world\n");
return 0;
}

On the other hand, if you open a window in Windows you have to use
platform-specific code, so the program is not easy to port to other OSes.
 
C

Cael

Rick Ng Chi Wah said:
Dear all,

I am a beginner of C language.
I want to know following C terminologies:

preprocessor
complier
object code
linker
executable file

What is the functions of these terms in a C program compilation
process??

Pls help me.
Thanks!

One more question, can compile DOS and Windows C source code under
Linux without any change/modify ??

Thanks!

IHO, you should read your C language book and I sure you can find all of
them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,297
Latest member
EngineerD

Latest Threads

Top