Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how a function gives a pointer as parameter c++

//example that uses pointer as parameter

// function definition to swap the values.
void swap(int *x, int *y) {
   int temp;
   temp = *x; /* save the value at address x */
   *x = *y; /* put y into x */
   *y = temp; /* put x into y */
  
   return;
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #function #pointer #parameter
ADD COMMENT
Topic
Name
5+7 =