Advertisement

Compiling a C Program

    On a personal computer using Visual Studio, you will create a .c file, e.g. hello.c (as in the previous example).  You will then compile it to produce a .exe file (e.g., hello.exe) and perhaps a .obj file (hello.obj).  Consult your compiler documentation (each one is different).



·        In Visual Studio, do a File|New and you will see the following dialog...



·        Here, you must first select Win32 Console Application.  Then press the ... button that appears to the right of the Location



·        Now choose the location.  You may need to create a folder on your file system.  In this case, I brought up the Windows NT explorer and created the new folder Ece11-s98.  Whatever you do, you should place the project in a place such that you can easily find it later.


·        Now that you have specified a Location, i.e. a folder where you want your project created, you should see the following...



·        Now, specify the name of your project.  Visual Studio will create a folder underneath the one you specified for Location by that name.  This will also become the name of your executable... Finally, click on the OK button to record your selection.




·        It is very important that you do each of these initial steps in the exact order that I have described above.  That is, first specify that you want a Console Application, then specify the location, then specify the project name.  Do not forget any of these steps.  In other words, pay attention!!!
 ·        As a result, you will see the following in Visual Studio

Notice that the Workspace window now has three tabs.  It has a ClassView tab, a FileView tab, and an InfoView tab.  Select (point the mouse to) the FileView tab. 



After selecting the FileView tab, you should see the following.  Notice what appears in the Workspace window...


·        Now we need to create a source file and include it in the project.  If we do the correct sequence of steps, Visual Studio will automatically include the new file into the project.
·        Do a File|New and select Text File and then specify a File name.  Do not accept the default choice, Active Server Page (or whatever happens to be the default).  Do not select C/C++ Header File.  Do not select C++ Source File.  Select Text File.  Do not forget to type in the file name, i.e. hello.c (or whatever you wish to call it), but it must end with .c !!!  The file suffix tells Visual Studio what type of file this is so it knows which compiler to invoke on it. Finally, click OK to select your choice.


As a result of your efforts, you should see the following.



·        I usually move the windows around at this point, adjusting the sizes.
·        Type in the program.



·        If you click on the + by Hello files under Workspace, you will see a list of all of the files in your project

·        Build your program by selecting the Build|Build menu option



·        Run it (Build | Execute)



Now let's look at the files:
Hello.dsw: this is your WORKSPACE
Hello.dsp: this is the project build file
These two files, along with hello.c are worth saving.



·        The program we just built is HELLO.EXE under the Debug directory


·        Because it is a CONSOLE application, we can run it directly from our Windows NT command (or Windows 95 Dos) prompt.
·        When I typed hello below at the Dos prompt, Windows ran the program hello.exe.  Below you can see the results of this run.


Compiling Under UNIX

To compile a C program under UNIX, one may do it in the following ways:

% cc hello.c

This compiles the file and creates an executable named a.out

% cc hello.c -o hello

This compiles the file but renames the executable hello

% cc -c hello.c

This compiles the file but does not link it, thus producing an object module which may be linked later on.  That file, by default, is hello.o

% cc hello.o -o hello

This links the object file hello.o to create the executable hello

Under UNIX, suffixes are important (i.e., .c versus .o).  They tell the compiler what type of file they are, i.e. a C program file versus an object module.

% cc foo.o bar.o -o fubar

This links two separately compiled modules into an executable named fubar.

The compiling process -- overview



Compiling process -- translation phases (ANSI)

1.  Physical source file characters are mapped to the source character set (including new-line characters and end-of-file indicators) if necessary.  Trigraph sequences are replaced by corresponding single-character internal representations.

2.  Each instance of a new-line character and an immediately preceding backslash character (\) is deleted, splicing physical source lines to form logical source lines.

3.  The source file is decomposed into preprocessing tokens and sequences of white-space characters (including comments).  A source file shall not end in a partial preprocessing token or comment.  Each comment is replaced by one space character.  New-line characters are retained.

4.  Preprocessing directives are executed and macro invocations are expanded.  A #include preprocessing directive causes the named header or source file to be processed from phase 1 through phase 4 recursively.

5.  Each source character set member and escape sequence in character constants and string literals is converted to a member of the execution character set.

6.  Adjacent character string literal tokens are concatenated and adjacent wide string literal tokens are concatenated.

7.  White-space characters separating tokens are no longer significant.  Each preprocessing token is converted into a token.  The resulting tokens are syntactically and semantically analyzed and translated.

8.  All external object and function references are resolved.  Library components are linked to satisfy external references to functions and objects not defined in the current translation.  All such translation output is collected into a program image which contains information needed for execution in its execution environment.



Worksheets

 

UKG Worksheets 

English 

Handwriting practice sheets

Cursive Writing – Small Letters

Alphabet Tracing

Tracing

Trace the Path

Positions

Sizes

Circle The Shape

A TO Z WORKSHEET

A TO Z SMALL LETTERS

CVC Words Building

Write the First Letter of Given Picture

Circle the Correct Letter Worksheets

Circle the Cursive Letter Worksheets

Match the Letter with Correct Picture

Match the Picture with Cursive Letter

Circle two pictures that begin with same letter sound

Circle two pictures that begin with same letter sound (Cursive)

CVC Worksheets Letter ‘a’

CVC Worksheets Letter ‘e’

CVC Worksheets Letter ‘i’

CVC Worksheets Letter ‘o’

CVC Worksheets Letter ‘u’

Look and write with vowels a, e, i, o, u

Opposite Words

2 Letter words - sight words

Science.

Science

Geography.

Geography

Weather

Calendar

Mathematics.

Trace Numbers 1 to 10

Measuring Things

Additional Worksheet.

Additional Worksheet.

Additional Worksheet

Subtraction Worksheets

Same, Less, More

Count and Write Worksheets

Count and Match Worksheets

Count and Circle Worksheets

Fill in the Missing Number Worksheets

What Comes After & Between

Write Missing Numbers

Shape worksheets

Backward counting

Trace the numbers 1-10

Multiplication Sheet practice for Children

Counting practice from 1 to 100 Worksheet

Miscellaneous in Maths

Hindi

Hindi Alphabets. (Swar)

Hindi Alphabets. (Vanjan)

Colours name in Hindi | रंगों के नाम

Fruits name in Hindi | फलों के नाम

Vegetables name in Hindi | सब्जियों के नाम

Days in Hindi

Parts of Body

Hindi Swar Tracing Worksheets

Hindi Vyanjan Tracing Worksheets

Write the First Letter of picture - Hindi Swar Worksheets

Look and Match - Hindi Swar Worksheets

Circle the correct letter - Hindi Swar Worksheets

Write the first letter - Hindi Vyanjan Worksheets

Circle the Correct Letter - Vyanjan Worksheets

Choose the Right Image - Vyanjan Worksheets

Miscellaneous Hindi Worksheets

2 Letter Words Hindi Worksheets

3 Letter Words Hindi Worksheets

4 Letter Words Hindi Worksheets

AA (ा) – AA ki Matra | आ (ा) की मात्रा

i ( ि) - i ki Matra | इ ( ि) की मात्रा

EE ( ी) – EE ki Matra | ई ( ी) की मात्रा

U (ु) - U ki Matra | उ (ु) की मात्रा

O (ू ) – OO ki Matra | ऊ (ू) की मात्रा

E ( े) - E ki Matra | ए ( े ) की मात्रा

AI (ै) - AI ki Matra | ऐ (ै)की मात्रा

o ( ो) - o ki Matra | ओ (ो) की मात्रा

ou ( ौ) - ou ki Matra | औ ( ौ) की मात्रा

General Knowledge.

GK Worksheets

Preschool Assessment

Nursery GK Worksheet

Creative Worksheets

Social Skills

People at Work

Finger Puppets

Shapes

Good Or Bad

Things That Go Together

Things That Do Not Belong

Match the following.

Match the fruit to its shadow. [5 Pages]

Match Letters [35 Pages]

Matching Worksheets

Sorting Worksheet

Shadow Matching

Match the uppercase letter to its lowercase [6 Pages]

Circle 2 Matching Pictures

Games.

Cut and Paste

Matching Cards

Puzzles and Mazes

Spot the Differences

Freak - Out !!!

Freak - Out !!! 

Sudoku

Cut and Glue

This Week

Literature.

Nursery Rhymes

Cursive Alphabet Trace and Write

Letters A to G Upper and Lower Case Tracing Worksheet

Beginning Sounds. Kindergarten Worksheet

Cursive Writing Small Letters.

Capital Letters.

Small Letters.

Alphabet Trace.

Alphabet Trace and Write.

Alphabet Worksheet 

Consonant Vowel Consonant (CVC) Flashcards

Story PDF.

Two Cats and Clever Monkey

The Lion and the Rabbit

The Lion and the Mouse

Reading Passages.

Reading Passages for Kids 

Coloring.

Coloring for Fun.

Dot to Dot

Color Cute Dinosaurs

Color Cute Animals

Alphabet Coloring.

Coloring Images

Colors

Drawing

Circle the Color

English Alphabet Color it. 

English Alphabet Color it and Match it with Pictures

Alphabet Color it. [26 Pages]

Alphabet Color it 2. [7 Pages]

English Alphabet Color it. 2 

Numbers PDF.

Numbers 1 to 10 Color it. [2 Pages]

1 to 10 Numbers Coloring. [4 Pages]

Flash Cards PDF.

Tell the Time Flash Cards [6 Pages]

Flashcards English vocabulary [12 Pages]

Alphabet Letters with Pictures [5 Pages]

Numbers Flash Cards. [5 Pages]

Shapes FlashCards. [4 Pages]

Colors FlashCards. [3 Pages]

English Alphabet Learning Flash Cards. [26 Pages]

Alphabet Flashcards. [26 Pages]

Alphabet Identification Flash Cards. [26 Pages]

….

11,000+ Printable Activity Worksheets Bundle

FREE With Lifetime Access: 

https://www.omtexclasses.com/p/printable-pdf-worksheets-for-kids.html

11000+ Preschool + Kindergarten Printable Activity Worksheets

These are printable pdf files. We do not sell hard copies. 

Inside 11,000+ Bundle You Will Get :

Countless coloring page

Alphabet tracing sheets

Math worksheets

Shape recognition exercises

Animal-themed activities

Scissor cutting practice

Flash Cards

Seasonal and holiday printable

And so much more!

Is it a digital product or Physical Product ?

11000+ Printable Activity Worksheets PDF is a digital product which you can instantly access for free of cost, and print whenever you wish.

We are always happy to see our products helping you to accomplish your goals. 

.