introduction to C

22
Lecture 1 Introductory Class CSE-105: Structured Programming

description

East West University Bangladesh , computer science teaching lectures, NB:only C lecturer in university who provides Digital lectures

Transcript of introduction to C

Page 1: introduction to C

Lecture 1Introductory Class

CSE-105: Structured Programming

Page 2: introduction to C

CSE-105

Course Code: CSE-105Course Title: Structured Programming Course Teacher: Md. Shamsujjoha Credit: 3 (Theory) + 1 (Lab) = 4

Page 3: introduction to C

Syllabus

Introduction of Computer Programming, Problem solving techniques, algorithm specification and development, Programming style, debugging and testing, documentation. Program design methodologies, structured and modular program design. Programming Language in C: Introduction to C, programming file structure: purpose of .h and .c files, Simple Makefile, constant, variable and data types, operator and expression, type conversion, decision making, branching and looping, arrays and strings, user defined functions, structures and union, bit field and bit-wise operations, pointer, file management in C, command line arguments, dynamic memory allocation and linked list, preprocessor, low level programming, managing input/output operation. Unix Shell: shell command, filters, viewing file and statistics, comparing and sorting, pipe, text processing, regular expression, grep family, stream edit with sed. Shell Programming: variables, environment variables, built in variables, defining words – quotes; test – string, number, file properties, Bolean operators; control structure – if-then-else, case, while loop, for loop. Make: Managing large program, Makefile, Makefile rules. Awk Programming: command line syntax, input, output, pattern matching, expressions, control statements, built in variables, arrays, built in functions, user define function

Page 4: introduction to C

Gist of Syllabus

Part : 1 Introduction of Computer Programming, Programming style, program

design. Part : 2

programming file structure: purpose of .h and .c files, constant, variable and data types, operator and expression, type conversion,

Part : 3 decision making, branching and looping, arrays and strings, user defined functions,

Part : 4 structures and union, bit field and bit-wise operations, pointer, dynamic memory allocation and linked list.

Part : 5 file management in C, command line arguments,

Page 5: introduction to C

Reference Book

Text-1: C – How to Program (7th

Edition) – Deitel & Deitel

Page 6: introduction to C

Reference Book

Text-2: Programming in ANSI C

(Latest Edition) – Balagurusamy

Page 7: introduction to C

Reference Book

Text-3: Teach Yourself C (3rd Edition)

– Herbert Schildt

Page 8: introduction to C

Reference Book

Ref-1: Schaum’s Outlines:

Programming with C (2nd Edition) – Byron Gottfried

Page 9: introduction to C

Reference Book

Ref-2: The C Programming

Language – Brian W. Kernighan and Dennis M. Ritchie, Prentice Hall Inc, Second Edition.

Other documents will be provided as PDF files

Page 10: introduction to C

Useful Web links

http://www.cs.bu.edu/courses/cs101/http://www.mtholyoke.edu/~blerner/

cs101/Labs/http://courses.cs.tamu.edu/dzsong/csce206-

f12/CSCE206-lab1.htmlhttp://metalab.uniten.edu.my/~masyura/

GOOD one

Page 11: introduction to C

Course Website

http://groups.yahoo.com/group/cse_msjCSE-105

You will find Syllabus Course lecture Lab Manual PDF documents Midterm exam news Results Assignments Others…

Page 12: introduction to C

Software required for this course

Windows Environment (any one): Code Block 8.02 or later version Microsoft Visual C++ 6.0 or later version Eclipse, vi & gcc

Linux Environment: Eclipse vi & gcc

Page 13: introduction to C

About the Course

Hardware vs. SoftwareSystem Software vs. Application SoftwareOperating SystemWhat is language? Programming language?Syntax vs. Semantics?What should we expect after completion this

course?

Page 14: introduction to C

Learning Style

This course is practical oriented.We will give lots of assignments.

(because practice makes a man perfect )

Memorization will not help you to get a good result.

Copying Code: Strictly prohibited. Will be severely punished if you are caught.

Page 15: introduction to C

Typing Speed (Not related to this course but Important)

Important for every student in CSETry to type in grammatical way

Use 10 fingers to type

Use software to learn grammatical way of typingSpeed:

Should be at least 30 WPM (Words per minute) Preferable 35+ WPM.

Rewards..Software

Ten Thumbs Typing Software, Or, any other Typing tutor software, I will provide you two of them.

Page 16: introduction to C

16

Description of C

General-purpose languageProcedural (= functions + data)Mid-levelRelatively small, simple to learnCross-platform language, single-platform compilers

(unlike Java)Char-based

Page 17: introduction to C

17

Why C?

Prior to C, two broad types of languages: Applications languages

High-level COBOL, etc. Portable but inefficient

Systems languages Low-level Assembly Efficient but not portable

Goal of C: efficient and portableHow: abstract above hardware arch, but not far!

Page 18: introduction to C

18

Why not Java, C++, etc.?

Java is safe and elegant, but slowC++ is unsafe and fast, but highly complexC is unsafe, but succinct and fastC/C++ is still used for:

Systems programming Windows, Unix, etc.

High-perf back-end servers

Page 19: introduction to C

A Simple C Code

#include <stdio.h>

int main()

{

printf(“Welcome to CSE105\n”);

return 0;

}

Page 20: introduction to C

How to Run

Save a source code with extension “c” or “cpp”. (Ex: first.c)

Compile it and link it Output: first.exe

Run the program.Output of the program:

Welcome to CSE105

Page 21: introduction to C

Questions or Suggestions

Page 22: introduction to C

Thank You!

Query : [email protected]@ewubd.edu