[ create a new paste ] login | about

Link: http://codepad.org/atWUV6gt    [ raw code | output | fork ]

C++, pasted on Jul 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
class sample
 {
private:
int x;
public:
friend void fun(const sample& s1)
{
   sample s;
  s.x = 100;
  std::cout<<"test";
}
};

int main()
{
    sample s;
    fun(s);
}


Output:
1
test


Create a new paste based on this one


Comments: