C++ programming help

FluffyTDestroyer

EGO Zealot
Joined
Jul 1, 2007
Messages
1,662
Howdy! I'm looking for help from some one with C++ experience. Here's the issue:

Using visual studio 2008, so keep in mind, files are in .h and .cpp but can be copied to a text doc to show what's going on.

Basically, it's a console based hangman game, that I need help with. The problem is in trying to pull words from the word list document into the program, and make it possible to ADD words to the dictionary/word list. It's for a final project, and it's just frustrating trying to debug/finalize when there seems to be some issue with syntax errors and 'friends'.

So far, part of the problem was realizing there was no header for the dictionary, but that was already remedied. Menu clashes have been ironed out for the most part, but still... Lost is a really good term to describe the present situation.

HELP! If you're familiar with C++/Visual studio 2008, I'd be eternally grateful if you could spare a few minutes and either hit me (or Deets) up on Vent, or send me a PM.
 
I don't do much (or any) windows programing, but I do TON of c++ program...can you be more specific about your problem? Are you just having trouble reading/writting to a file (dictionary)?
 
The way I understand it is he is having a problem getting a word from the word bank and passing it to the game properly.
I don't know how much help I can be because I know Java right now, but I'll see what I can do to help.
 
I don't do much (or any) windows programing, but I do TON of c++ program...can you be more specific about your problem? Are you just having trouble reading/writting to a file (dictionary)?

Right now I'm having problems adding multiple words to the dictionary text document. When I add a word, it replaces the last word, making it the ONLY word in the dictionary file. I've tried putting in \n to send it to a new line, but it comes out the same way every time with just the one word. That's pretty much where I'm stuck right now. But stick around, I'm sure I can find even more problems with my coding if I try hard enough.

Any ideas?
 
sounds like you opened the file handle wrong.

Did you open it in append mode?
 
I pretty much agree with DragonD. If you're overwriting the whole file, then you're writing at the beginning instead of the end. If you're just overwriting the "last" word, with more than one word in the list, then you've got some seek math a bit off.

What happens if you create a 3-entry file by hand and run it in your program?
 
Thanks for all the help! The project was completed successfully, and the class is over for now.

Thank you to everyone who took time out of their schedule to help out. It is MUCH appreciated! :thumbup:
 
Well, what was your problem:)

What other comp classes do you plan on taking?
 

Latest posts

Back
Top