Without seeing some code, who knows what you did wrong?
Have you read beej yet?