Common Errors about Pointer in C Language

https://w‮‬ww.lautturi.com
Common Errors about Pointer in C Language
int i, *ptr;

//  ptr holds the address, but i is the value
ptr = i;  // error

// &i is address,but *ptr isn't
*ptr = &i;  // error

//  &i 和 ptr are address both
ptr = &i;  // that is ok

// i 和 *ptr are values both
*ptr = i;  // that's ok
Created Time:2017-08-28 14:56:10  Author:lautturi