Download presentation
Presentation is loading. Please wait.
Published byCornelius Wilson Modified over 9 years ago
1
CSCI 130 Chapter 1
2
History of C Bell Telephone Laboratories (1972) Dennis Ritchie (also created UNIX) A - B - C
3
Initially Many Versions Incompatibility ANSI –American National Standards Institute ANSI Standard C
4
Advantages of C Powerful, Flexible –Operating Systems –Applications software –Compilers Popular Portable Modular (should be written in functions)
5
Problem Solving Technique Define Problem Devise plan to fix problem Implement the plan Test
6
Necessary Information Is computer program required? Inputs/Outputs Formulas Organization (flow of logic)
7
Ex: Find area of a circle Is computer required? Inputs / Outputs –Need the radius of circle as input –Area will be the output Formulas –Area = pi * radius ^ 2
8
Find area of circle - continued Flow of logic: –Request radius of circle –Calculate area = pi * radius ^ 2 –Output area
9
Steps in C programming cycle Use editor to create source code Compile source code into object code Link object file into executable file Execute file
10
Use editor to create source code Any editor can be used –Editor supplied with language Any text based editor DOS editor Notepad Write program following syntax of language Save file as: filename.c
11
Compile Source Code Different compilers use different commands Most (such as Borland, Code Warrior) have IDE - can compile via GUI interface Process creates a new file: filename.obj This file is object code - in format readable by machine
12
Link object file Most compilers will do this via GUI interface as well (may combine compiling and linking) Links internal C library functions (such as printf, scanf) with source code Creates new file: filename.exe
13
Execute Program Program can now be executed –Type filename at DOS prompt –Most compilers allow program to be run via GUI interface may combine compiling, linking, and running Finished product can be shared –source code does not have to be shared
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.