第五讲 针和字符串.ppt

5.2 指针变量的声明和初始化 (Pointer Variable Declarations and Initialization) Pointer variables Normally, variable contains specific value (direct reference) Pointers contain memory address of variable that has specific value (indirect reference) Pointer declarations * indicates variable is pointer int *myPtr; declares pointer to int, pointer of type int * Multiple pointers require multiple asterisks int *myPtr1, *myPtr2; 5.3 指针运算符(Pointer Operators) (address operator) Returns the address of its operand Example int y = 5; int *yPtr; yPtr = y; // yPtr gets address of y yPtr “points to” y 5.3 指针运

文档评论(0)

1亿VIP精品文档

相关文档