Thanks I didn't know that sdl_pollevent is so important. That must be the error here WILL thanks for that info too. I was trying something similar I just coulnd't experience how what I was trying was working and debug it because of this freeze thing. It's just a small game and it gave me more headache in a few days than most of my previous programs overall.(Except for one... OFF:
That was some kind of record handler. Read in some variables and stored them in binary files and I wrote a search engine for it. One of the parameters of the record was an array of strings called "tags". Now I've tried like when searching it just simply asks for a string which looks like this:"tag1 tag2 tag3 tag4" of course this is one string and I had to do some tricks to fraction the strings at the spaces and get them into another array and with a double for loop I just compare all to all. For some reason however the results were windings like characters so they never made a match. I just solved that by first asking for number of tags and then read them in one by one but I was upset because the other way would have been more cool and I already wrote functions like it counts how many words a string consits of and others)