[ create a new paste ] login | about

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

C++, pasted on Oct 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class A {
   friend void fun(A a);
   friend void fun2();
   friend void fun3();
};

void fun(A a) { std::cout << "I'm here"  << std::endl; }
void fun2()   { std::cout << "I'm here2" << std::endl; }
void fun3();

int main() 
{  
    fun(A()); // works ok
    //fun2(); error: 'fun2' was not declared in this scope
    //A::fun2(); error: 'fun2' is not a member of 'A'
    fun3(); // works ok
} 


Output:
1
2
In function `main':
undefined reference to `fun3()'


Create a new paste based on this one


Comments: