Skip to content

Commit

Permalink
add Pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas98320 committed Jun 6, 2016
1 parent 4dad273 commit 5145647
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions C++/Pointer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <stdio.h>
#include <cmath>


void update(int *a,int *b) {

int tmpA = *a;
*a = *a + *b;
*b = fabs(tmpA - *b);

}

int main() {
int a, b;
int *pa = &a, *pb = &b;

scanf("%d %d", &a, &b);
update(pa, pb);
printf("%d\n%d", a, b);

return 0;
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Day 7: Arrays<br>

<h3>C ++</h3>
Say "Hello, World!" With C++<br>
Pointer<br>

0 comments on commit 5145647

Please sign in to comment.