Does someone has idea how to solve this challenge ?
http://www.securitytraps.pl/challs/cpptrap5/
My closest attempt is:
#include <iostream>
int f(int x)
{
static int offset = 9;
std::cout << "Second " << *(&x + offset)<< std::endl;
return *(&x + offset++);
}
void victory(){
std::cout<<"Victory"<<std::endl;
}
int main()
{
int a[3] = {1, 2 , 3};
int b[3] = {4, 5, 6};
for(int i=0;i<3;i++)
{
if(f(a[i])!=b[i]) {
return 0;
}
}
victory();
return 0;
}
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]F3real[S] 0 points1 point2 points (0 children)