|
Please read about how to post a good question. It's stuck right at the top of the forum.
That said, are you testing the result of the fopen instruction to see if it failed, and if so, why? You can't open a file that doesn't exist. There are a number of other reasons. Did you test to see if cin worked? Your code doesn't show that.
Information is key. For you, and for your potential respondents. Check for errors. See what they mean. Use output statements to see what various values are. Use a debugger. SHARE that information, when you post, and include enough code so that we can see what you're actually doing.
|