What am I doing wrong?
Not posting a complete program
I can make no sense of the snippets that you posted