This sort of issues is covered in any beginner's C book. Please read such a book before asking for help debugging your code. -- Torbjörn