summary refs log blame commit diff stats
path: root/assignments/24-value-vs-ref.c
blob: 864079224efc57ab47df9238bdb3639a29ebbfcd (plain) (tree)




















                                
#include <stdio.h>

void swap_by_value(int a, int b)
{
	int c = a;
	b = a;
	b = c;
}

void swap_by_ref(int *a, int *b)
{
	int c = *a;
	*a = *b;
	*b = c;
}

int main(void)
{
	return 0;
}