Video Lecture Notes

Video Lecture Notes - • All pointers are an address •...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Video Lecture Notes Variable Declarations:[class] [type] [name] [Class] o Auto Default o External Common to the whole program Global to the program Defined outside the function boundary Declared as “extern” in a function o Static Variable is initialized the first time it enters a sub-program, then remains static Is initialized only once [Type] o Integer “int” o Float “float” o Character “char” Pointers: variables that point to memory location Every pointer has a data type associated with it A declaration with a “ * “ before the variable name creates a pointer
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • All pointers are an address • & operator o Returns the address of its argument • * operator o Returns the data to which it is pointing to Arrays: • Every array has a data type associated with it • An array name is also a pointer to the start of an array • In C, all variables are passed by “call by value” except arrays which are passed by “call by reference” • arr[i] *(arr + i) points to the ith row in arr • arr[i]+j *((arr + i) + j) points to the [i, j]th element of arr...
View Full Document

This note was uploaded on 03/19/2012 for the course MATH MATH 304 taught by Professor Young during the Spring '09 term at Texas A&M.

Ask a homework question - tutors are online