Here is the answer to your question

http://www.cprogramming.com/cboard/a...p?s=&forumid=4