Help with Structure and I/O
I'm trying to write a program that can read in customer info from a text file.
The text file is formatted as follows:
Each customer should take one structure, and I'd like to be able to search by either name or transaction number.
I'm not really sure how to read in the data and store it into the structures. I've been reading through a few books for the past couple of days and each one seems to skip around and use different syntax, and trying to search online seems that everyone wants to write from their struct to a file, not from the file to a struct. I understand that once you open the file you can handle the data similarly to like using cin, but I guess I'm just not too comfortable with structures to know what I'm doing.
Here's some basic things I've started with, can you give me a little help to get the ball rolling?
using namespace std;
int main(int argc, char *argv)
info person; //starting with 10 people to just see if it works
ifstream in("custo.txt"); // Open file custo.txt
if (not in)
for (int i = 0; i < 10; i++)
//read in name, id, address and store in that customers struct