Summary CSE 2031 Fall 20101 5 May 2019.

Slides:



Advertisements
Similar presentations
Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
Advertisements

Dynamic Memory Allocation (also see pointers lectures) -L. Grewe.
Introduction to Programming Lecture 39. Copy Constructor.
Engineering EG167C - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review.
By Senem Kumova Metin 1 POINTERS + ARRAYS + STRINGS REVIEW.
Kernighan/Ritchie: Kelley/Pohl:
Memory Arrangement Memory is arrange in a sequence of addressable units (usually bytes) –sizeof( ) return the number of units it takes to store a type.
C and Data Structures Baojian Hua
Review on pointers and dynamic objects. Memory Management  Static Memory Allocation  Memory is allocated at compiling time  Dynamic Memory  Memory.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review Topics.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
CP104 Introduction to Programming File I/O Lecture 33 __ 1 File Input/Output Text file and binary files File Input/output File input / output functions.
 200 Total Points ◦ 74 Points Writing Programs ◦ 60 Points Tracing Algorithms and determining results ◦ 36 Points Short Answer ◦ 30 Points Multiple Choice.
1 Pointers and Arrays. 2 When an array is declared,  The compiler allocates sufficient amount of storage to contain all the elements of the array in.
File IO and command line input CSE 2451 Rong Shi.
Topic 3: C Basics CSE 30: Computer Organization and Systems Programming Winter 2011 Prof. Ryan Kastner Dept. of Computer Science and Engineering University.
Lecture 15: Course Review BJ Furman ME 30 16MAY2011.
17-Feb-02 Sudeshna Sarkar, CSE, IT Kharagpur1 Arrays and Pointers Lecture 17 18/2/2002.
Arrays and Pointers (part 2) CSE 2031 Fall March 2016.
Department of Electronic & Electrical Engineering Lecture 3 IO reading and writing variables scanf printf format strings "%d %c %f" Expressions operators.
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 10/11/2006 Lecture 7 – Introduction to C.
Arrays and Pointers (part 1) CSE 2031 Fall July 2016.
CSC 215 Pointers and Arrays. Pointers C provides two unary operators, & and *, for manipulating data using pointers The operator &, when applied to a.
ECE Application Programming
The Machine Model Memory
5.13 Recursion Recursive functions Functions that call themselves
Characters and Strings
Lecture 8 String 1. Concept of strings String and pointers
Command Line Arguments
CSE 303 Concepts and Tools for Software Development
C++, OBJECT ORIENTED PROGRAMMING
Pointers.
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
Student Book An Introduction
Arrays and Pointers CSE 2031 Fall September 2018.
Pointers in C Good morning Ladies and Gentlemen. Welcome to this talk on “Pointers in C”
14th September IIT Kanpur
CSC 253 Lecture 8.
CS 2308 Final Exam Review.
5. Arrays, Pointers and Strings
CSC 253 Lecture 8.
Arrays & pointers C How to Program, 8/e.
I/O in C Lecture 6 Winter Quarter Engineering H192 Winter 2005
CS 2308 Exam I Review.
Introduction to Programming
Instructor: Ioannis A. Vetsikas
Memory Allocation CS 217.
Chapter: 7-12 Final exam review.
Pointers.
Chapter 17: Linked Lists.
Chapter 16 Pointers and Arrays
EE 312 Exam I Review.
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
Chapter 9: Pointers and String
Chapter 9: Pointers and String
Structures CSE 2031 Fall April 2019.
Arrays and Pointers (part 2)
EECE.2160 ECE Application Programming
Quick Review EECS May 2019.
CSCE 206 Lab Structured Programming in C
Arrays and Pointers (part 2)
Characters and Strings
EECE.2160 ECE Application Programming
EE 312 Exam I Review.
ENERGY 211 / CME 211 Lecture 29 December 3, 2008.
Review.
Arrays and Pointers.
CSE 303 Concepts and Tools for Software Development
EE 312 Exam I Review.
Presentation transcript:

Summary CSE 2031 Fall 20101 5 May 2019

C Basics Data types and type conversion Precedence and order of evaluation Control flows Functions Passed by value Passed by reference I/O: getchar, printf, scanf File access

Precedence and Order of Evaluation 3

Structures Structures and functions Arrays of structures Pointers to structures Passed by value Passed by reference Self-referential structures (linked lists)

Pointers Function arguments Relationship with arrays Address arithmetic Strings (char pointers) Arrays of pointers; pointers to pointers char *p1[10] versus char (*p2)[10] Pointers and 2D-arrays Dynamic memory allocation Command-line arguments

UNIX Basic UNIX commands Shell scripting (all) How to study: first learn the basics then … Step 1: for each example/script, describe in detail what the script does, what will be printed. Step 2: (a couple of days later) read the problem descriptions, write the scripts (without looking at the lecture notes) and make them run.

During the exam … No questions You will be given Table of precedence ASCII code table UNIX reference sheets

Pointers and Arrays int a[10], *pa; pa = a; /* same as pa = &a[0]*/ pa++; /*same as pa = &a[1]*/ a[i]  *(a+i) &a[i]  a+i pa[i]  *(pa+i) Notes a = pa; a++; are illegal. Think of a as a constant, not a var. p[-1], p[-2], etc. are syntactically legal. 8

Arrays of Pointers: Example char *words[] = { “apple”, “cherry”, “prune” }; char **p; p = words; printf("%c\n", **p); printf("%c\n",*(*(p+1)+2)); printf("%c\n",*(*(p+2)+2)+1); +1 9