View Single Post
Old 11-30-2012, 01:27 PM   #3
justin_ator
🥓<strong><span style="col
Resident Overseer
FFR Veteran
 
justin_ator's Avatar
 
Join Date: Mar 2007
Location: Kingsport, TN
Posts: 7,648
Default Re: C++ fstream and arrays

Well my issue isn't so much how to compare or get results, it's in the process of setting it up.

I'm reading in a text file using fstream, that would have the list like this
username [#,#,#,#,#][#][#]
username [#,#,#,#,#][#][#]
username [#,#,#,#,#][#][#]
username [#,#,#,#,#][#][#]
username [#,#,#,#,#][#][#]
username [#,#,#,#,#][#][#]
username [#,#,#,#,#][#][#]

and I'm running it in a loop for each line, so that's not the issue either. The issue is how do I save the #'s to an array while ignoring the [ , ] stuff when reading from the file?

I was using getline, but then I can't separate the #'s into each guess[] spot because they're being read in as character strings, but input.get(); is giving me weird values. I have no idea what I'm doing lmfao
justin_ator is offline   Reply With Quote