C-Dynamic Data Structures

C-Dynamic Data Structures - ECE 175: Introductory C for...

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

View Full Document Right Arrow Icon
ECE 175: Introductory C for Engineers Dynamic Data Structures
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 175: Introductory C for Engineers - Dynamic Data Structures Pointers Pointers point to memory locations The value of num is 5 (num) The value in the memory location pointed to by nump is 5 (*nump) When you declare nump You can any value you want in nump, but you may not be able to access that location You may also have pointers to structures 2 100 5 104 103 101 102 100 int num; int *nump = # Data/Value Address num nump Variable STUDENT_RECORD *srp;
Background image of page 2
ECE 175: Introductory C for Engineers - Dynamic Data Structures Dynamic memory allocation The following program segment does not run correctly Results in a bus error The value of ipointer is some garbage The memory location pointed to by ipointer is not ours We need to have a memory location reserved for us to store an integer We then need to make ipointer point to that location
Background image of page 3

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

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

This note was uploaded on 04/03/2008 for the course ECE 175 taught by Professor Grubbs during the Spring '08 term at Arizona.

Page1 / 11

C-Dynamic Data Structures - ECE 175: Introductory C for...

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