centralized performance resources
This commit is contained in:
commit
50b15a1522
63 changed files with 328466 additions and 0 deletions
21
ocw/1/c-primer/swap.c
Normal file
21
ocw/1/c-primer/swap.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (c) 2012 MIT License by 6.172 Staff
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void swap(int i, int j) {
|
||||
int temp = i;
|
||||
i = j;
|
||||
j = temp;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int k = 1;
|
||||
int m = 2;
|
||||
swap(k, m);
|
||||
// What does this print?
|
||||
printf("k = %d, m = %d\n", k, m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue