Dear friends, i dont know where to post this question.
i was writing a program using glut library in c++. i compile and run program. but there was a bug in the program that halts my system. i restart the system and system works fine for half of an hour then it freeze and now after every half hour if get freeze. i dont know where the problem. plz help me to fix my pc.

operating system is microsoft windows xp professional edition service pack 3

You mean it crashes like that without even running your program?? My immediate guess is that your program has harmed either the video device driver or RAM chip. Try downloading and running a computer diagnostics program.

i tried to reinstall my windows but during installation it freeze

Did your C++ program perform any low level function, overwriting an unfortunate disk sector?

Seems like you're having hardware problem there. Nothing to do with C++. My suspect is bad RAM. Second in line is CPU.