C and C++ challenges

Pages: 12
closed account (S6k9GNh0)
You assume that you know the stack frame the compiler generates (which of course will depend on compiler options and optimization levels).


I've never knew this was possible. :/

Originally posted by helios:
1
2
3
4
5
void f(){
	int *i=(int*)(unsigned(&i)+92),*j=(int*)(unsigned(&j)+92);
	std::cout <<*i<<","<<*j<<std::endl;
	return;
}



@helios

It might be ugly, dirty and downright wrong, but that is quite impressive! I've spent so long writing 'middle-tier' software, I forget things like that are even possible. I suggest you go have a good wash after writing that :)
Topic archived. No new replies allowed.
Pages: 12