C Programming Language Bill Jensen CS 354 May, 3 rd 2007.

Slides:



Advertisements
Similar presentations
C language was developed in early 1970s by Dennis Ritchie at Bell Laboratories to implement the UNIX operating system on the PDP-11 manufactured by DEC.
Advertisements

Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Introduction to C Programming CE Lecture 1 Introduction to C.
CSE1301 Computer Programming Lecture 4: C Primitives I.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 12 Imperative Programming I really hate this.
Three types of computer languages
Reasons to study concepts of PL
ISBN Chapter 1 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Motivation Programming Domains.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
Programming C/C++ on Eclipe C Training Trình bày : Ths HungNM.
ISBN Chapter 1 Topics Motivation Programming Domains Language Evaluation Criteria Influences on Language Design Language Categories Language.
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
‘C’ LANGUAGE PRESENTATION.  C language was introduced by Dennis Ritchie..  It is a programming language, which can make a interaction between user and.
Programming Language Concepts
Team Badass.  Dennis M. Ritchie  1967 He became an employee at Bell Labs  Mid 1960s BCPL was developed by Martin Richards for the Multics Project 
Computer Science 210 Computer Organization Introduction to C.
“C” Programming Language CIS 218. Description C is a procedural languages designed to provide lowlevel access to computer system resources, provide language.
C: A VERY BRIEF HISTORY & STANDARDS © 1/4.
CS 11 C track: lecture 1 Preliminaries Need a CS cluster account cgi-bin/sysadmin/account_request.cgi Need to know UNIX ITS.
Basics of “C” Programming
CS 355 – Programming Languages
CS 363 Comparative Programming Languages
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
C Programming language
Five Tips to Success. Work hard Try more exercises and more practice.
Programming Language C++ Xulong Peng CSC415 Programming Languages.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
C Programming language Basic Concepts Prepared By The Smartpath Information systems
These notes were originally developed for CpSc 210 (C version) by Dr. Mike Westall in the Department of Computer Science at Clemson.
What is C? C is a programming language. It was developed in 1972 USA. It was designed and written by a man named dennis ritchie. C is the base for all.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
COP 3275 Chapter 01 course website: Jonathan C.L. Liu, Ph.D. CISE Department University of Florida.
Introduction to C programming. History of C programming Invented and Developed by Dennis Ritchie and Brian Kernighan at Bell Laboratories in 1972 Predecessor.
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
MAHENDRAN. Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
CSC141 Introduction to Computer Programming Programming Language.
Fundamentals of Programming C++ Programming Language CS 1400 Dennis A. Fairclough Version 1.1 C++ Programming Language CS 1400 Dennis A. Fairclough Version.
Introduction to C Programming I Subject: T0016 – ALGORITHM AND PROGRAMMING Year: 2013.
From Algorithms to Programs Both are sets of instructions on how to do a task Algorithm: –talking to humans, easy to understand –in plain (English) language.
The Machine Model Memory
Concepts of Programming Languages
PROGRAMMING LANGUAGES
1. INTRODUCING C.
Chapter 1 Reasons to study concepts of PLs Programming Domains
C Language VIVA Questions with Answers
Java for Android is specific
Intro to Programming Week # 1 Hardware / Software Lecture # 2
1.1 Reasons to study concepts of PLs
Learning C Language.
Introducing C Chapter 1 Copyright © 2008 W. W. Norton & Company.
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
C Basics.
Prepared By: G.UshaRani B.Pranalini A.S.Lalitha
CGS 3460 Course Web Site Get CISE Account.
Introduction to C Programming Language
' C ' PROGRAMMING SRM-MCA.
INTRODUCTION c is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs.
11/10/2018.
CS 3304 Comparative Languages Fall 2011
Introducing C Chapter 1 Copyright © 2008 W. W. Norton & Company.
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Introduction to Computer Programming
C programming Language
The C Language: Intro.
C Language B. DHIVYA 17PCA140 II MCA.
Reasons To Study Programming Languages
Presentation transcript:

C Programming Language Bill Jensen CS 354 May, 3 rd 2007

Catalyst Ken Thompson wanted a comfortable computing environment of his own design. B programming language was created, based on languages used when creating Multics; especially BCPL. Thompson decided Unix needed a system programming language. In late 1960’s Bell Labs left project on Multics, and soon after he and others began working on the Unix Operating System.

Creation By 1970 Unix had shown promise and Bell Labs acquired the new DEC PDP-11 By 1971…We all wanted to create interesting software more easily. B’s problems – 1) Clumsy Character handling 2) Floating point not available on PDP-11 3) Implied overhead with pointers Alterations to B and a new name, NB.

Creation - continued NB proved to be insufficient and with further changes was renamed to C. Many changes around , but main was introduction of preprocessor. Portability developed as I/O Libraries written by Mike Lesk produced changes focused on portability and type safety Brian Kernighan and Dennis Ritchie Published The C Programming Language.

Control - standardization Portability tests (Interdata 8/32, DEC VAX 11/780) lead to wide spread use during the 1980’s. Compilers became available on most every machine architecture. Wide use, including use on commercial and Government projects lead to establishment of X3J11 committee established by ANSI to produce a standardization of C.

Characteristics An Imperative, Procedural programming language. Design based on the implementation of computer processors based upon the von Neumann architecture. Low level access to memory by machine addresses and typed pointers.

Variables, Types & Operators Variables - Must begin with letter followed by any number and combination of letters and digits. (strings are implemented as char arrays) Types – char, int (short, long), float, double shorts, ints – min 16 bits Long – min 32 bits Binary Operators: +, -, *, /, % Logic Operators: >, >=, <, <=, ==, !=, &&, ||, ! (negate) Bitwise: &, |, ^, >, - (unary)

Assignment Expressions Assignment: =, +=, -=, *=, /=, &=, ^=, |=, >= Most associativity is Left to Right Ex. x = 1 + 2; Ex. y += 4; (y = y + 4;)

Control Flow If-Else, Else-If, Switch, Loops, GOTO Loops – While, For, Do-while GOTO and Labels – GOTO’s can be useful in error handling in special cases but usually should be avoided Labels – same form as a variable followed by a colon “goto statements should be used rarely, it at all” – Kernighan, Ritchie

Pointers and Arrays Pointers contain addresses of variables. Ex. int x = 10; // var x has value of 10 int *ptr; // ptr points to the address of an int ptr = &x; // ptr now has value of x (10) Arrays can be declared normally and as pointer arrays. Ex. Int array[] // one dimensional int twoDimArray[][] // two dimensional array * Pointer arrays are usually faster but harder to understand.

Structures Structures – a collection of one or more variables or any type. Structures are used to help organize complicated data. Ex. Struct account { char *accountHolder; double checkingBalance; double savingsBalance; }

Conclusion Readability – overall easy to read and intuitive. Pointers can make reading code difficult. Simplicity – simple design making c easy to learn and apply. Orthogonality – c is not very restrictive, which allows some creativity and some higher chances of writing bugged code.

Conclusion - continued Easy to learn basic concepts. Lack simple implementation of object oriented programming can make class OOP tedious.

Primary Uses True to its original purpose C is most often used in systems programming. Operating Systems Embedded Systems Intermediate Language for higher-level languages * Java Computer Game Programming

Bibliography Kernighan, Brian W., and Dennis M. Ritchie. The C Programming Language. New Jersey: Prentice Hall, Sebesta, Robert W. Concepts of programming languages. Boston: Pearson, Ritchie, Dennis M. The Development of the C Language*. Murray Hill, NJ:. "C (programming language)." wikipedia.org. April, 25 th