Computer Systems and Networks
LECTURE 5: C PROGRAMMING
Computer Systems and Networks
Dr. Pallipuram (vpallipuramkrishnamani@pacific.edu)
University of the Pacific
Today's Class
o Pointer basics oPointers and multi-dimensional arrays
o malloc, calloc, free o 2D array manipulation for Lab 4
o Strings in C
Pointer Arithmetic
Only addition and subtraction are allowed with pointers.
All pointers increase and decrease by the length of the data-type they point to.
Example: If an integer pointer, iptr holds address 32, then after the expression iptr++, iptr will hold 36 (assuming integer is 4 bytes).
Problem 1
The name of the array is actually a pointer pointing to the first element of the array.
printf("\n", %u:array+3); //prints?______ printf("\n", %u:*(array+3)); //prints?______
Two methods of traversing 1-D array
Pointer Method
Subscript Method
for (i=0;i ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- p2 magic square
- assignment 2 pointers and dynamically allocated multi
- c pointers arrays and strings boise state university
- lecture 08 dynamic memory allocation
- c dynamic data structures
- csci 6610 intermediate programming c c array
- computer systems and networks
- short notes on dynamic memory allocation pointer and data
Related searches
- introduction to computer systems pdf
- computer systems manager job description
- computer systems analyst skills
- computer systems analyst certification
- computer systems analyst
- computer systems 3rd pdf
- types of computer systems pdf
- what computer systems are there
- computer systems analyst indeed
- computer systems analysts information
- computer systems analyst jobs
- computer systems analyst requirements