<<< Command-line arguments | Index | >>> |
swap( ) is a function that swaps values of two integer variables:
void swap( int* px, int* py ) { int temp = *px; *px = *py; *py = temp; } int main( ) { int x = 5; int y = 10; swap( x, y ); // Error: must take address swap( &x, &y ); // Correct return 0; }
<<< Command-line arguments | Index | >>> |