i declared a friend function in one class...as shown below...
classa.h
class A
{
public:
friend void friendFunction(void);
void somefunction(void);
.................
}
class A
{
public:
friend void friendFunction(void);
void somefunction(void);
.................
}
To copy to clipboard, switch view to plain text mode
classa.cpp
void class A::somefunction()
{
......
friendFunction();
}
void class A::somefunction()
{
......
friendFunction();
}
To copy to clipboard, switch view to plain text mode
main.cpp
..........
.............
void frienFunction(void)
{
/* function implementation...*/
}
..........
.............
void frienFunction(void)
{
/* function implementation...*/
}
To copy to clipboard, switch view to plain text mode
but i'm getting compiler error saying that "friendFunction not declared in this class"
please help me whats the wrong here!??
Bookmarks