Lecture18 - ECS 30 Introduction to Programming and Problem...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECS 30 Introduction to Programming and Problem Solving Franois Gygi Department of Computer Science Midterm: Monday Nov 7 Chapters 1 8.5, Lectures 1-17 Bring your own paper (blue book not needed) Duration 50 min. Please come early and be seated and ready by 1:10p No book or notes allowed No calculators Lecture 18 Chapter 8 arrays, segmentation faults and gdb passing parameters with pointers using arrays sorting searching multidimensional arrays Using arrays: segmentation faults Reading/writing beyond the end of an array may (or may not) cause a segmentation fault The gdb debugger can be used to analyze the behavior of a program as it runs Compile with: gcc g myprog.c search "gdb tutorial" See e.g. Andrew Gilpin's tutorial http://www.cs.cmu.edu/~gilpin/tutorial/ program segfault.c Passing arguments with pointers void sort2(int *a, int *b) { int tmp; if ( *a > *b ) { tmp = *a; *a = *b; *b = tmp; } }...
View Full Document

Page1 / 18

Lecture18 - ECS 30 Introduction to Programming and Problem...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online