📜  指针运算符 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:39.245000             🧑  作者: Mango

代码示例1
&  ==> address operator
*  ==> dereference operator

// Example
int a = 1;
int *ptr; // int * defines a pointer variable pointing at an int
ptr = &a; // the address of 'a' is assigned to the pointer

// 'ptr' is now equal to the address of 'a'
// when dereferenced using *, it returns the value at that address

printf("value of a: %d", *ptr); // prints "value of a: 1"