Addictgamer Posted January 25, 2010 Share Posted January 25, 2010 DO NOT RUN THIS UNLESS YOU WANT TO KILL YOUR PC. How it works? overruns an array. Many noobs make this type of mistake. #include <iostream> #include <string> #include <sstream> using namespace std; int a[2]; int temp = 1; int *temp2; string buff; string itos(int i); int main() { cout << "Killing your pc!\n"; while (temp == 1) { for(int i = 1; i > 0; i++) { a[i] = i; temp2 = &a[i]; buff = itos(*temp2); cout << "Killing address: " << buff << endl; } } return 0; } string itos(int i) { // convert int to string stringstream s; s << i; return s.str(); } Link to comment Share on other sites More sharing options...
Anonymouse Posted January 25, 2010 Share Posted January 25, 2010 Compiled on linux. Run on linux. Doesn't kill linux. LINUX WINS! :P Link to comment Share on other sites More sharing options...
Lair Posted January 25, 2010 Share Posted January 25, 2010 I somehow doubt it actually does kill PC. otherwise you wouldn't have posted it Link to comment Share on other sites More sharing options...
Addictgamer Posted January 26, 2010 Author Share Posted January 26, 2010 I ran it on windows, and dep stopped it before killing windows I ran it on Linux and it killed my Linux HAH MOUSE It doesn't kill it, just requires reboot. Link to comment Share on other sites More sharing options...
dabomb29 Posted January 27, 2010 Share Posted January 27, 2010 If that code kills your PC you might want to spoiler it. Otherwise.....neat :P Link to comment Share on other sites More sharing options...
Addictgamer Posted January 27, 2010 Author Share Posted January 27, 2010 It just fills up your ram with an overrun array, and overwrites existing memory addresses. Windows stops it with dep, but my linux installation doesn't. Mouse's does though. It is the most epic programming fail a noob can do. Link to comment Share on other sites More sharing options...
Recommended Posts