hey guys,
i’m writing a fork bomb. I don’t want to use it on other computers, just to prank friends once. all it does (in c++) is while true, allocate 1mb of RAM and fork. I have a problem. With g++ on windows from mingw, I get an error that says the fork command is unrecognized. When i comment that line out, when I run it and inspect it from the taskmanager, it stays at a constant 12mb of RAM. my include lines consist of:
#include
#include
If anyone can help that’d be great. Part of the reason i want to do this is for my own satisfaction, when I get mad at my computers just run this. I’ve already compiled this (with the fork command included) and tested it with Ubuntu Linux 8.10 and Mac os 10.5.6 leopard. It worked on both of those.
thanks,
alright so also how do i fix the 12k ram problem and malloc not doing anything? at this point i’m just taking up CPU by looping forever.
why isn’t malloc working? is it because i’m overwriting my pointer every time?

fork() doesn’t exist under Windows. fork() is only for Unix/Linux. This is why it works fine for you under Mac OS and Ubuntu.
Under Windows you would have to spawn a child process, but this is not the same as forking a process.