20.01.2011, 08:43
Maybe because you dont even have something to get the id with, your just creating a new variable 'tmp' and then getting the number out of it (which would obviously return 0) try using something that will actually get the id for you (IE strtok, sscanf)