문제

I have 2 functions like this that does obfuscation on if loop:

void funcA(string str)
{
    size_t f = str.find("if");
    if(f!=string::npos)
    {
        funcB(str);        //obfuscate if-loop
    }
}

void funcB(string str)
{
     //obfuscate if loop
     funcA(body_of_if_loop);     //to check if there is a nested if-loop
}

The problem with this would be that funcA would not be able to see funcB and vice versa if I put funcB before funcA.

Would appreciate any help or advice here.

도움이 되었습니까?

해결책

What you want is forward declaration. In your case:

void funcB(string str);

void funcA(string str)
{
    size_t f = str.find("if");
    if(f!=string::npos)
    {
        funcB(str);        //obfuscate if-loop
    }
}

void funcB(string str)
{
     //obfuscate if loop
     funcA(body_of_if_loop);     //to check if there is a nested if-loop
}

다른 팁

A forward declaration would work:

void funcB(string str); 

void funcA(string str)
{
    size_t f = str.find("if");
    if(f!=string::npos)
    {
        funcB(str);        //obfuscate if-loop
    }
}

void funcB(string str)
{
     //obfuscate if loop
     funcA(body_of_if_loop);     //to check if there is a nested if-loop
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top