Datasim Financial Forums Forum Index


 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
The operator ++ and C calling

 
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> C++ Certification and Examinations: Advanced Level
View previous topic :: View next topic  
Author The operator ++ and C calling
Cuchulainn



Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands

PostPosted: Mon Sep 27, 2010 8:49 pm    Post subject: Reply with quote

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;

}
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> C++ Certification and Examinations: Advanced Level All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group