All pastes #270390 Raw Edit

'Swap' function

public c v1 · immutable
·published 2006-12-07 09:26 UTC
rendered paste body
#include <stdio.h>void swap(int *,int *);  // This function swaps two variables //int main (void) { int a = 5;              // Two testing values // int b = 10; printf("%d,%d \n",a,b);  swap(&a,&b); printf("%d,%d",a,b);  return 0;}// The 'swap' function, swaps two variables using a third   //// temporary variable which is destroyed after the execution//// of the function.											// void swap(int *a,int *b) { int tmp; tmp = *a; *a = *b; *b = tmp;  }