C++Guns – RoboBlog

16.11.2014

Spass mit Pointer

Filed under: Allgemein — Tags: , — Thomas @ 20:11

"man kann sich so derbe den kopf weg schiessen damit"


int global;

char *func() {
  return (char*)&global;
}

int main() {

  char *x = func();
  int *RocketPtr = (int*)x;
  *RocketPtr = 1337;
  cout << global;
}

Output : 1337

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress