The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
Passing Values
Posted by: Practice Function Test | November 4, 2010 @ 1:53am
C++ Code
[
Download
]
#include <iostream> using namespace std; int Foo(int * iOne, int & iTwo); int Foo2(int iOne, int iTwo); int Foo3(int * iOne, int iTwo); void main() { int a(0); int b(1); int c(5); Foo(&a, b); c = Foo(&b, a); a = Foo3(&c, b); c++; cout << a << endl; cout << b << endl; cout << c; system("pause"); } int Foo(int * iOne, int & iTwo) { *iOne += 2; iTwo -= 3; iTwo++; --iTwo; *iOne = Foo2(*iOne, iTwo); return *iOne; } int Foo2(int iOne, int iTwo) { iOne += 10; iTwo = 6; iOne = iTwo; iTwo--; return iOne+iTwo; } int Foo3(int * iOne, int iTwo) { iTwo = 0; *iOne++; return iTwo; }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.55 / 8
71 Votes