Groups
Groups
Sign in
Groups
Groups
Ankara University Com 102 society
Conversations
About
Send feedback
Help
Midterm2-question 6 source code
23 views
Skip to first unread message
Hacer Keles
unread,
May 3, 2013, 12:32:32 PM
5/3/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to com...@googlegroups.com
#include <iostream>
using namespace std;
class A
{
int a;
public:
A(int aa=0)
{
a = aa;
}
void print()
{
cout<<a<<endl;
}
// add function definition
A& add(int x)
{
a+=x;
return *this;
}
// multiply function definition
A& multiply(A& x)
{
a*=x.a;
return *this;
}
};
int main()
{
A a1(2);
A a2(6);
a1.add(3).multiply(a2);
a1.print();
}
int x;
merve bayram
unread,
May 3, 2013, 12:36:59 PM
5/3/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to com...@googlegroups.com
A& multiply(A x)
{
a*=x.a;
return *this;
}
hocam bu soruda 2.fonksiyonu şu şekilde yazmış olsak herhangi bir sorun olmaz değil mi sonuç değişmiyor.
2013/5/3 Hacer Keles
<
hacer...@yahoo.com
>
Hacer Keles
unread,
May 3, 2013, 3:34:23 PM
5/3/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to com...@googlegroups.com
Hayır sorun olmaz. Doğru sonucu verecek alternatif sonuçların hepsi ok.
H.
From:
merve bayram <
mrv.b...@gmail.com
>
To:
com...@googlegroups.com
Sent:
Friday, May 3, 2013 7:36 PM
Subject:
Re: [com102] Midterm2-question 6 source code
Reply all
Reply to author
Forward
0 new messages