introduction lecture1

14
INTRODUCTION TO TURBO C LANGUAGE IS104 ± Progra mming Fun dament als and Data Structur es Using C Ms. Aileen P . de Leon, MIT, MOS 

Upload: aileen-p-de-leon

Post on 10-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 1/14

INTRODUCTION TO TURBO C

LANGUAGEIS104 ± Programming Fundamentals and Data Structures Using C

Ms. Aileen P. de Leon, MIT, MOS 

Page 2: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 2/14

TURBO C is commonly known as C Language programming

developed by Dennis Ritchie at Bell Laboratories in 1972.

Considered machine-independent assembly language

rather than a higher-level language.

Standardized by American National Standards

Institute(ANSI).

Is a compiled language that contains a small set of 

built-in functions that are machine dependent.

Composed of one or more functions defined by the

user programmer or the professional programmer 

Is a sensitive programming language

Page 3: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 3/14

PROGRAM ± is a list of instructions written in a

programming language that a computer can execute so that

the machine acts in a predetermined way.

is a sequence of instructions that can be executed

by a computer.

May refer to the original source code or to the

executable version or known as the machine

language.

Page 4: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 4/14

TURBO C LANGUAGE

COMPONENTSIS104 ± Programming Fundamentals and Data Structures Using C

Ms. Aileen P. de Leon, MIT, MOS 

Page 5: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 5/14

COMPILER ± refers to any program that transforms one set

of symbols into another by following a set of syntactic and

semantic rules.

it is a program that translates all the source codes of a

program written in a high-level language into objectcodes prior to the execution of the program.

Page 6: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 6/14

DEBUGGER ± is a program designed to help in debugging

another program by allowing the programmer to step through

the program, examine data, and check conditions.

Two Basic Types of Debugger:

MACHINE-LEVEL ± displays the actual machineinstructions(assembly language) and allow the

programmer to look at registers and memory locations.

It is also used for testing a program and locating

programming errors.

SOURCE-LEVEL ± program built for specific-purpose

problems.

Page 7: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 7/14

EDITOR ± it is a program designed for altering

sequences of words and numbers, but without the

features of a full-fledged word processing program.

Text editors are used for writing source codes as well

as creating basic text documents.

Page 8: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 8/14

BASIC PARTS OF A TURBO C

PROGRAMMINGIS104 ± Programming Fundamentals and Data Structures Using C

Ms. Aileen P. de Leon, MIT, MOS 

Page 9: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 9/14

HEADER FILES ± files provide function prototype

declarations for library functions.

1. conio.h ± declares various functions used in calling

the Disk Operating System(DOS) console

Input/Output(IO) routines.

2. dos.h ± defines various constants and gives

declarations needed for DOS AND 8086 specific calls.

3. float.h ± contains parameters for floating-point

routines.

Page 10: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 10/14

4. graphics.h ± declares prototypes for the graphics

functions.

5. math.h ± declares prototypes for the math functions.

6. mem.h ± declares the memory manipulationfunctions.

7. process.h ± contains structures and declarations for 

spawn and executable functions.

Page 11: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 11/14

8. stdio.h ± defines types and macros needed for the

standard I/O.

9. stdlib.h ± declares several commonly used routines:

conversion routines, search/sort routines, and other 

miscellany.

10. string.h ± declares several string manipulation and

memory manipulation routines.

Page 12: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 12/14

#include DIRECTORY ± preprocessor directive instructs

the compiler to include another source file with one that

has the #include directive in it. The source file to beread must be enclosed between double quotes or angle

brackets.

MAIN BODY ± refers to the set of statements in a

computer program at which the execution of the

program begins and from which the execution branches

to the subroutines of the program.

MAIN FUNCTION ± this is the main body of a program

that performs the principal function of a program over 

and over until termination is somehow signaled.

Page 13: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 13/14

RESERVED WORD ± fixed function and cannot be used for 

any other purposes. It may only be used for its intended

purpose; it cannot be used for naming files, variables, or other user-named objects. It has a special meaning to a

program or in a programming language. It can be used only

in a certain predefined circumstances.

PRINTF ± this is a reserved word used to output function

that commands the computer display the message on the

screen which is enclosed in double quotations.

SCANF ± used to read information from the keyboard.

SEMICOLON ± it is used to separate one statement to

another statement.

Page 14: Introduction Lecture1

8/8/2019 Introduction Lecture1

http://slidepdf.com/reader/full/introduction-lecture1 14/14

GETCH(); - this part gets characters from the keyboard, and

does not echo on the screen.

GETCHE(); - gets characters from the console, and echoes

on the screen.

FILENAME ± refers to the set of letters, numbers, and

allowable symbols assigned a file that distinguishes it from allother files in a particular directory or folder on a disk.

MESSAGE WINDOW ± it lies beneath the edit window and is

used to display various compiler or linker messages.

SYNT AX ERROR ± this is an error in the use of language

syntax; a statement that violates one or more of the

grammatical rules of a language and is thus not legal.