Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Mon Sep 27, 2010 8:49 pm Post subject: |
|
|
What's happening here?
// Quiz.cpp
//
// Run with VS 2010
//
// DJD
#include <iostream>
#include <string>
using namespace std;
void fu1(int a, int b, string s)
{ // call by value
cout << s << "--> ";
cout << "First arg: " << a << ", ";
cout << "Second arg: " << b << endl;
}
int main()
{
int i = 10;
fu1(i,i, "0");
i = 10; fu1(i++,i++, "1"); // 11,10
i = 10; fu1(++i,++i, "2"); // 12,12
i = 10; fu1(i++,i,"3"); // 10,11
i = 10; fu1(i,i++, "4"); // 11,10
i = 10; fu1(++i,i, "5"); // 11,11
i = 10; fu1(i,++i, "6"); // 11,11
return 0;
} |
|