Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ poitner

// A pointer in c++ is a variable whose value is a memory address. 

int main() {
  	int x;      // 'regular' int
  	int *y;     // 'pointer-to-an-int
  
    x = 5;      // assign x some value which is an integer
    y = &x;     // use the address-of operator to get the address of x;
                // store that value as the value of y. 
	return 0; 
}
 
PREVIOUS NEXT
Tagged: #poitner
ADD COMMENT
Topic
Name
5+2 =