lec07

lec07 - Debugging CS 2022 Introduction to C Instructor...

Info iconThis preview shows pages 1–4. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Debugging CS 2022: Introduction to C Instructor: Hussam Abu-Libdeh Cornell University (based on slides by Saikat Guha) Fall 2009, Lecture 7 Debugging CS 2022, Fall 2009, Lecture 7 Before we begin... I A quick note on arrays I We said that there are similarities between arrays and pointers I You can use pointers as if they they are arrays (i.e. ptr[1] ) I But they are not exactly the same Debugging CS 2022, Fall 2009, Lecture 7 Before we begin... I ptr1 = ptr2; makes sense I Here we are assigning the value of variable ptr2 to the variable ptr1 I The values just happen to be memory addresses I array1 = array2; does not make sense I array1 and array2 are the base addresses of the array, but they are not full-fledged pointers (we can not have them point to different memory locations) I C does not automatically copy the values of one array to another (what if they are different in size?) I So expressions like array1 = array2; and char str[100] = argv[1]; will give you compilation errors Debugging CS 2022, Fall 2009, Lecture 7 Print Debugging...
View Full Document

This document was uploaded on 03/10/2011.

Page1 / 10

lec07 - Debugging CS 2022 Introduction to C Instructor...

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

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