Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

C Common mistakes when working with pointers

int c, *pc;

// pc is address but c is not
pc = c;  // Error

// &c is address but *pc is not
*pc = &c;  // Error

// both &c and pc are addresses
pc = &c;  // Not an error

// both c and *pc are values 
*pc = c;  // Not an error
 
PREVIOUS NEXT
Tagged: #C #Common #mistakes #working #pointers
ADD COMMENT
Topic
Name
7+2 =