Fun with rand()
Compile and run with gcc blah.c && ./a.out:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int x[2] = {618270585, 58852637};
int i;
for (i = 0; i < 2; i++) {
srand(x[i]);
while (1) {
int c = rand() % 27;
if (c == 0) {
break;
}
putchar('a' + c - 1);
}
putchar(' ');
}
putchar('\n');
}
In general, when someone says to compile and run some random code on the internet you should ignore them (since there are enough people out there writing dodgy code that will intentionally delete your stuff). I tell people to do it all the time, but typically it is with code where if you read it it would be obvious what it is doing. It isn't obvious what this code will actually do, but if you know a little bit of c, you can probably tell that it won't do anything bad.
When I run it on my webserver, I get this output: "zggwkrqcikhqycq kadmsdicbknhua". When I run it on my desktop I get a much more pleasant message.

RSS