0.o yay lag program :)

Sep 17, 2009 at 9:43pm
I was bored so in the middle of my simple program I decided too mess it up to see what would happen and:


!!!! WARNING !!!!
This will seriously slow your computer
so follow these steps to escape:

1:Press ctr+alt+del
1 1/2:Go to the processes tab
2:Find your project name (eg. project 1)
2 1/2:Click on it
3:End the process via the end process button

I don't know if this works on macs or unix systems
so ... use wisely

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <cstdlib>
#include <iostream>
#include <conio.h>

using namespace std;

void cmd(string typeCommandHere){
    if (typeCommandHere == "pause"){
         int c;
          printf( "\nPress a key to continue..." );
          c = getch();
          if (c == 0 || c == 224) getch();
    }
  }

void matrixPrint(string matrix[][2]){
    int i = 0;
    int l = 0;
    while (l != 2){
          while (i != 2){
                cout << matrix[l][i];
                ++l;
          }
          ++i;
    }
}

int main(int argc, char *argv[])
{
    string fish [2][2] = {
        {"1","0"},
        {"0","1"}
    };
    matrixPrint(fish);
    cmd("pause");
    return 0;
}
Last edited on Sep 17, 2009 at 9:50pm
Sep 17, 2009 at 9:46pm
Ctrl+C might work, if it is a console program. Also, why do cmd and matrixPrint return ints? They aren't ever returning anything.
Sep 17, 2009 at 9:49pm
..... umm ...... hehehehe ..... bad practice?
fine I void them
Last edited on Sep 17, 2009 at 9:50pm
Sep 19, 2009 at 2:16am
closed account (S6k9GNh0)
I can think of many more complex ways to destroy a computer.
Sep 19, 2009 at 5:40am
I once edited autoexec.bat on my friend's DOS comp back in computer tech to do this:

Error. Autofix? (y/n) y
Current drive is no longer valid>


He was confused until he typed dir and found all it did was change the prompt text hehe
Sep 19, 2009 at 11:43pm
If you try to make gigantic arrays (like int giantarray[100000000][1000000000][1000000000][100000000][100000000];) it can do some really wierd things to your computer. especially if you thy to create a bunch of them in an infinite loop.

I wouldn't recommend it though...
Last edited on Sep 19, 2009 at 11:44pm
Sep 19, 2009 at 11:44pm
Yes there are but the point was I did it while messing with my array ... Why are you so cruel computer quip?

Also if you have a semi fast computer that your not afraid of locking up go through it it outputs .... interesting things like symbols ... and halfway through it looks very organized ... why does it do that?
Sep 20, 2009 at 12:42am
I got a segfault. By the way, I don't have conio.h, so I replaced all of the "getch()"s with "std::cin.get()"s.
Last edited on Sep 20, 2009 at 12:42am
Sep 20, 2009 at 8:25am
closed account (S6k9GNh0)
rvbman47, that's not a valid sentence. It would be:

int ***** pGiant = new int[100000000][1000000000][1000000000][100000000][100000000]

The OS would stop you before you allocated that much onto stack >.>
Last edited on Sep 20, 2009 at 8:25am
Sep 20, 2009 at 3:50pm
rvbman47, that's not a valid sentence. It would be:

int ***** pGiant = new int[100000000][1000000000][1000000000][100000000][100000000]


I don't understand. Are you saying that his version would not run because
The OS would stop you before you allocated that much onto stack >.>
? Or are you saying that his version is not valid C++?

If it's the first one, then your version would do the same thing, since when you say new int[100000000][1000000000][1000000000][100000000][100000000], you are allocating the memory anyways.

If it's the second one, you're wrong, because his version is perfectly fine C++.

Unless you're saying that if you allocate the memory on the heap, then the OS won't stop you, whereas on the stack it will?
Sep 20, 2009 at 6:30pm
I bet that neither automatic and dynamic memory will find that much contiguous memory
Anyway, int ***** pGiant = new int[100000000][1000000000][1000000000][100000000][100000000] is wrong: http://www.cplusplus.com/forum/articles/7459/
Sep 21, 2009 at 9:29pm
I really don't know exactly what it did, but when it tried to make the array, it crashed the computer.

Here's exactly what I typed in for the code:
int numbers[1000000][1000000][1000000][1000000][1000000];
Last edited on Sep 21, 2009 at 9:32pm
Sep 21, 2009 at 9:50pm
You making 1,000,0004 integer arrays may have something to do with that.
Sep 22, 2009 at 8:40pm
Thread has been Hi-Jacked T_T
Sep 22, 2009 at 8:50pm
Yeah. Good, isn't it?
Topic archived. No new replies allowed.