Declare C function as friend inside CPP class
I need to use a private class variable inside a C function. I was doing something like this
class Helper
{
private:
std::string name;
public:
std::getName(){return name;}
friend extern "C" void initializeHelper();
};
but this code segment gives error unqualified-id before string constant
extern "C" {
I cannot determine what I am doing wrong here.
+2
source to share