Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
c++ x 12
Member Avatar for xfreebornx

#include <iostream> using namespace std; double average(int x); int main() { int a,b,c; cout <<"average is:"<<average(a,b,c); cin >>a>>b>>c; return 0; } double average(int x) { return (x+x+x)/3; }

Member Avatar for thug line
0
92
Member Avatar for dennis.wu

class B is nested insider class A but it does not declare the class B as its friend. However, the member function void B::print(A a) can access to the private member data int a, b of class A. The books introduce the nested class must be declared as friend then …

Member Avatar for dennis.wu
0
2K
Member Avatar for dennis.wu

A const member function is not supposed to operate the data member. However, it can operate the data member if it is a reference data type. Why can operate the reference data member even if the member function is constant? It is shown below: two classes: Bird & BirdHouse BirdHouse …

Member Avatar for dennis.wu
0
143
Member Avatar for dennis.wu

c++: Why the member functions of one class can access to private data member of other object? I use vs2008 and g++ compiler. the codes are list below: [CODE=c++] #include <iostream> using namespace std; class Integer { int i; public: Integer(int ii) : i(ii) {} const Integer operator+(const Integer& rv) …

Member Avatar for dennis.wu
0
142