CPS 125 Lecture 1: Pointers

136 views1 pages

Document Summary

Integer a stores the value assigned, which is 12. Integer b is a pointer variable, which points to the. #include int main(void) int a; int *b; address or memory location of a. This integer can not store a value. a=12; b=&a; printf( a = %d\n ,a); printf( *b = %d\n ,*b); pointing to the memory location of a, which holds the value 12. return(0); This will print out *b = 12 the pointer variable is. #include int main(void) int w; b/c the data type is int. int *q; int **n; w. w=41; q=&w n=&q printf( w = %d\n ,w); printf( *q = %d\n ,*q); printf( **n = %d\n ,**n); return(0); w is a scalar variable. *q stores the address of the integer value of w. **n stores the address of the pointer q, to the address of.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions