What does this program?

Hi! I saw a picture with a program and i am wondering what it does. I tested and it freezes the .exe. Can you tell me why?

1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;
int main;
{for(; ; )
cout<<'\a';
return 0;
}
  
Aside from the typos making this an invalid program, it creates an infinite loop that outputs the '\a' character infinitely.

Recall that in a for loop, all three parts are optional.
Last edited on
Thanks for you very very fast response! :D
Topic archived. No new replies allowed.