By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

Reading, char by char from text file?

P: 1
Hi, I was wondering how I could read, char by char letters from a text document.

I'm making a game, and I have decided this method is probably the easiest way to make maps with collision ect.

I the file is 48x27, so overall 1296 charactors need to be read, and the images drawn on screen, they then need to be read directly to check for collision, the only code I have found so far is to read each charactor in series.

Incase I explained that as bad as I think I did...

Open the file and read the first charactor, draw the corrosponding image on screen in the correct place, then read the next charactor. Once all charactors have been read, the player can then move, every time moving the charactor that corrosponds with the certain co-ordinates that the player is on must be read.

I have no sort of starting point for this, and I'm struggling to understand most of what I'm reading on Google searches. Reading/writing to external files has never been a strong point!

Well anyway, thanks in advance for any help.
Jun 19 '07 #1
Share this Question
Share on Google+
1 Reply

P: 1,806
If File Handling is your biggest concern, have a look through the c/c++ articles (available via the links on the blue bar near the top of the screen). You should find some useful information there.
Jun 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.