introduction to C

Post on 25-May-2015

142 views 8 download

Tags:

description

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

Transcript of introduction to C

Lecture 1Introductory Class

CSE-105: Structured Programming

CSE-105

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

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

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,

Reference Book

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

Edition) – Deitel & Deitel

Reference Book

Text-2: Programming in ANSI C

(Latest Edition) – Balagurusamy

Reference Book

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

– Herbert Schildt

Reference Book

Ref-1: Schaum’s Outlines:

Programming with C (2nd Edition) – Byron Gottfried

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

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

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…

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

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?

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.

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.

16

Description of C

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

(unlike Java)Char-based

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!

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

A Simple C Code

#include <stdio.h>

int main()

{

printf(“Welcome to CSE105\n”);

return 0;

}

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

Questions or Suggestions

Thank You!

Query : dishcse@yahoo.commsj@ewubd.edu