回首忆惘然
删除指针意味着获取存储在指针指向的内存位置中的值。操作符*用于执行此操作,并称为取消引用运算符。int a = 10;int* ptr = &a;printf("%d", *ptr); // With *ptr I'm dereferencing the pointer.
// Which means, I am asking the value pointed at by the pointer.
// ptr is pointing to the location in memory of the variable a.
// In a's location, we have 10. So, dereferencing gives this value.
// Since we have indirect control over a's location, we can modify its content using the pointer.
This is an indirect way to access a.
*ptr = 20; // Now a's content is no longer 10, and has been modified to 20.