C中的指针:cell =# num等于* cell = num?

时间:2017-04-09 17:54:56

标签: c pointers pointer-arithmetic

假设您有变量public interface IUpgradeable<TUpgrade> where TUpgrade : IUpgrade { TUpgrade UpgradeEntity{ get; } } public interface ISomeUpgrade : IUpgrade { // ... } public interface IUpgrade { // ... } public class SomeClass : IUpgradeable<ISomeUpgrade> { public ISomeUpgrade UpgradeEntity{ get; } } 和指针int num。 {(1}}和int* cell中存储的值是否会对cellnum有所影响?

1 个答案:

答案 0 :(得分:1)

cell = &num

表示单元格的内容/值等于num。

的地址
*cell = num

表示存储在单元格中的地址的内容,即指针指向的值,将等于num的值。