could you explain what your program is supposed to do? some comments on particular lines would be nice
...just a note, always have a return 0; statement at the end of int main to properly stop the execution, it might work without it on linux but the code should be able to be compatible on all compilers